50👍
✅
You can query across relationships with the django ORM (or in this case the reverse relationship):
person = Person.objects.filter(
membership__group=example_group,
membership__date_joined__gte=example_date
)
0👍
You can also do this:
person = example_group.members.filter(
membership__date_joined__gte=example_date
)
👤flix
- [Django]-How to alphabetically order a drop-down list in Django admin?
- [Django]-InvalidBasesError: Cannot resolve bases for [<ModelState: 'users.GroupProxy'>]
- [Django]-Django template how to look up a dictionary value with a variable
Source:stackexchange.com