Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. cookie_ids = Cookie.objects.filter(board__pk=self.kwargs['pk']).values_list('id',
  2. flat=True)
  3.  
  4. sugar_ids = Sugar.objects.filter(board__pk=self.kwargs['pk']).values_list('id',
  5. flat=True)
  6.  
  7. **then:
  8. context['cookie_actions'] = Action.objects.filter(target_id__in=cookie_ids)
  9. context['sugar_actions'] = Action.objects.filter(target_id__in=sugar_ids)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement