109👍
✅
if user.partner_set.filter(slug=requested_slug).exists():
# do some private stuff
7👍
If we just need to know whether a user
object is associated to a partner
object, we could just do the following (as in this answer):
if user in partner.user.all():
#do something
- [Django]-Python Asyncio in Django View
- [Django]-Django database query: How to get object by id?
- [Django]-Where should signal handlers live in a django project?
Source:stackexchange.com