Как обьявить аргумент fields в Django?
class createListing(forms.ModelForm):
title = forms.CharField(label= "Title", max_length = 32)
description = forms.CharField(label= "Description", max_length = 499)
price = forms.IntegerField(label = "Price")
class Meta(forms.ModelForm):
model = Category
fields = "__all__"
Вот сама ошибка:
django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form createListing needs updating.
UPD: Решил проблему: надо было перезапустить сервер
Источник: Stack Overflow на русском