Answer the question
In order to leave comments, you need to log in
How to forbid assigning id to fields of ForignKey of that object, whose certain field is equal to False?
There is a model:
class SomeObj(models.Model):
name = models.CharField(verbose_name='Название', max_lenght=100)
active = models.BooleanField(verbose_name='Активный', default=True)
desc = models.TextField('Примечание', blank=True)
Answer the question
In order to leave comments, you need to log in
I understand that in the resulting array you immediately want to group the values by attributes.
[loc_work] => Array( тут 1 и более )
[profession] => Array(тут 1 и более )
[com_name] => Array(тут 1 и более )
[com_inds] => Array(тут 1 и более )
If there are connections, they should be described, as I understand it, you need join
You can:
1. Validator for the form ( https://docs.djangoproject.com/en/3.2/topics/forms... )
2. Override the save() of the model ( https://docs.djangoproject.com/en/3.2 /topics/db/mo... )
3. Override form save() ( https://docs.djangoproject.com/en/3.2/topics/forms... )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question