List feature

+ implemented list feature
+ implemented category feature
This commit is contained in:
Clemens-Dautermann 2018-12-23 14:27:16 +01:00
parent 5877b83424
commit 32d60f51ac
23 changed files with 210 additions and 60 deletions

View file

@ -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()
}