[Django]-Django different model manager on foreign key

8👍

You can specify which manager to use in queries. If all_users = AllUserManager() then:

# address is instance of Address
address.users(manager='all_users').all()

Also, if all_users is default manager, you can set use_for_related_fields = True on AllUserManager.

👤vsd

Leave a comment