0👍
I don’t have any info from your form
, but DjangoForm
has exclude
property for that, you can access it viaself.exclude
, also its type is a list
, so you can append wanted field into that to exclude it
class Meta:
model = Model
exclude = ['field1', 'field2', ...]
- [Django]-Deleting the tags that are not used by any other object
- [Django]-Django: Formset for adding captions to uploaded images
- [Django]-Web Dev. Framework for RAD Web App Dev. in Shortest Time ( Yii vs. Django )
- [Django]-How would I write a CSV file populated with my sqlite3 db?
0👍
You can give only required fields in serializer class like this
class Meta:
model = Model_name
fields = (
'id',
'field1',
'field2'
)
- [Django]-.js files not included in page when using Django Form Assets (Media class) with crispy forms
- [Django]-Can't debug django app in VS Code with docker database: 'could not translate host name "db" to address: Name or service not known'
Source:stackexchange.com