Tanjim Hossain
6 years ago
I was trying to create 'EmailAddress' model to store multiple emails for an
'user'. The model has and 'is_primary' field with null=True and
unique_together = ('user', 'is_primary')
So if EmailAddress Instance has is_primary set to false, only one primary
email can be set for each user; And that's exactly I want.
but using validator with is_primary(BooleanField) is too much messy work to
do, No!?
Django should come with something like 'allow_false' by default for only
BooleanField
'user'. The model has and 'is_primary' field with null=True and
unique_together = ('user', 'is_primary')
So if EmailAddress Instance has is_primary set to false, only one primary
email can be set for each user; And that's exactly I want.
but using validator with is_primary(BooleanField) is too much messy work to
do, No!?
Django should come with something like 'allow_false' by default for only
BooleanField
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7cf93d1c-2115-4165-b412-367e8decd4c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7cf93d1c-2115-4165-b412-367e8decd4c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.