List feature
+ implemented list feature + implemented category feature
This commit is contained in:
parent
5877b83424
commit
32d60f51ac
23 changed files with 210 additions and 60 deletions
|
|
@ -1,12 +1,21 @@
|
|||
from django.forms import ModelForm, TextInput
|
||||
|
||||
from .models import Object
|
||||
from .models import Object, Category
|
||||
|
||||
|
||||
class ObjectForm(ModelForm):
|
||||
class Meta:
|
||||
model = Object
|
||||
fields = ('ammout', 'title', 'img', 'description')
|
||||
fields = ('ammout', 'title', 'img', 'description', 'category')
|
||||
widgets = {
|
||||
'title': TextInput(),
|
||||
}
|
||||
|
||||
|
||||
class CategoryForm(ModelForm):
|
||||
class Meta:
|
||||
model = Category
|
||||
fields = ['name']
|
||||
widgets = {
|
||||
'name': TextInput()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue