[Solved] Queryset inside fk attribute

Assuming you have a instance of the p class in self.p then the queryset S.objects.filter(r__p=self.p) would work. Next time put a bit more effort into your question though or people won’t want to put effort into an answer. 1 solved Queryset inside fk attribute

[Solved] How to filter Django queryset by non field values

I was able to solve the problem by pre processing the data to store the person’s timezone. Then using pytz I do this. from django.utils import timezone import pytz valid_timezones = [] for tz in list_of_timezones: local_time = now().astimezone(pytz.timezone(tz)) if 19 < local_time.hour < 20: valid_timezones.append(tz) reminders = Person.objects.filter(timezone__in=valid_timezones) solved How to filter Django queryset … Read more