class Item(models.Model):
......
category = models.ForeignKey(Category, verbose_name=u'Укажите категорию')
......
class Category(models.Model):
name = models.CharField('Name', max_length=50)
slug = models.SlugField('Slug')
class EditForm(forms.ModelForm):
class Meta:
model = Item
fields = ('category', 'mode', 'type', 'delivery' )
class EditForm(forms.ModelForm):
category = forms.ModelChoiceField(
queryset=Category.objects.all(),
label='Categories',
widget=forms.Select()
)
class Meta:
model = Item
fields = ('category', 'mode', 'type', 'delivery' )
Category
из моделей.