ForeignKey with limit_choices

linkaiyi
Follow

limit_choices with field restriction

limit_choices_to={‘is_staff’: True}

staff = models.ForeignKey('auth.User',
                              limit_choices_to={'is_staff': True},
                              verbose_name=_("Staff"),
                              related_name="db_relcallstaff",
                              blank=True,
                              null=True,
                              on_delete=models.SET_NULL)
Object has 0 attachments

Was this article helpful?

This article is viewed 18 times!

Recent Viewed Articles

Related Articles

0 Comments

Leave a Comment

Support