Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .idea/LibraryManager.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

592 changes: 291 additions & 301 deletions .idea/workspace.xml

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion Books/forms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.contrib.auth.models import User
from django import forms
from django.contrib.auth.forms import UserCreationForm

from Books.models import Book
from Books.models import Book , RequestedBooks


class BookForm(forms.ModelForm):
Expand All @@ -13,16 +14,39 @@ class Meta:
fields = ['title', 'author', 'book_logo', 'description']

class UserForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['email'].required = True
User._meta.get_field("email")._unique = True

password = forms.CharField(widget=forms.PasswordInput)
email = forms.EmailField(required=True)



class Meta:
model = User
fields = ['username', 'email', 'password']




class LoginForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput)

class Meta:
model = User
fields = ['username', 'password']


class RequestedBooksForm(forms.ModelForm):
title=forms.CharField(required=True)
author=forms.CharField(required=False)
RequestedBooks._meta.get_field("title")._unique = True
#publisher=forms.CharField(required=False)
class Meta:
model=RequestedBooks
fields=['title' , 'author' ]



9 changes: 7 additions & 2 deletions Books/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 2.0.7 on 2018-07-14 13:24
# Generated by Django 2.0 on 2018-09-01 11:45

from django.db import migrations, models

Expand All @@ -17,12 +17,17 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('author', models.CharField(max_length=100)),
('book_logo', models.FileField(default='', max_length=500, upload_to='')),
('taken_by', models.CharField(max_length=300)),
('description', models.TextField(blank=True)),
],
),
migrations.CreateModel(
name='Person',
name='RequestedBooks',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('author', models.CharField(blank=True, max_length=100)),
],
),
]
16 changes: 0 additions & 16 deletions Books/migrations/0002_delete_person.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0003_book_taken.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0004_auto_20180715_1823.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0005_book_book_url.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0006_auto_20180715_2015.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0007_auto_20180716_1046.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0008_auto_20180716_1052.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0009_auto_20180716_1432.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0010_auto_20180716_1438.py

This file was deleted.

19 changes: 0 additions & 19 deletions Books/migrations/0011_book_book_logo_url.py

This file was deleted.

17 changes: 0 additions & 17 deletions Books/migrations/0012_remove_book_book_logo_url.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0013_auto_20180724_1747.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0014_auto_20180724_1748.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0015_auto_20180724_1802.py

This file was deleted.

18 changes: 0 additions & 18 deletions Books/migrations/0016_book_description.py

This file was deleted.

Empty file modified Books/migrations/__init__.py
100644 → 100755
Empty file.
9 changes: 9 additions & 0 deletions Books/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ def get_absolute_url(self):

def __str__(self):
return self.title + ' - ' + self.author

class RequestedBooks(models.Model):
title= models.CharField(max_length=100)
author=models.CharField(max_length=100 , blank=True)
#publisher=models.CharField(max_length=100, blank=True)

def __str__(self):
return self.title+" - "+ self.author

Empty file modified Books/static/Books/images/ivory-off-white-paper-texture.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Books/static/Books/images/paper-background.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Books/static/Books/style.css
100644 → 100755
Empty file.
Loading