On 13 juil, 21:37, "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitymedialtd.co.uk> wrote:
> _users = map(lambda x: x.get('memberid'), Members.objects.filter( > username = self.username > ).values('memberid')) What's wrong with values_list ? member_ids = Members.objects.filter( username = self.username ).values_list('memberid', flat=True) And FWIW, did you try the obvious: return Session.objects.filter( member__username=self.username, is_fake = 0 ).order_by("-id") (not that it might necessarily be faster - depending on your dataset, indexes, hardware and whatnot). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.