Django - Limit the entries in models.ForeignKey()
class UserCustomer(models.Model):
user = models.ForeignKey(User)开发者_高级运维
customer = models.ForeignKey(CustomerProfile)
In admin interface, while adding a new record, is it possible to restrict(remove) the 'user' in user drop down, if that user is already associated with any customer?
Does this answer your question?
How about this one? He goes through multiple examples including filtering ModelAdmin inlines (which I think is what you're after).
精彩评论