In Django, what’s the difference between the following two: Article.objects.values_list('comment_id', flat=True).distinct() vs Article.objects.values('comment_id').distinct() My goal is to get a list of unique comment ids under each Article. I’ve read...
  • May 24, 2022
  • 0 Comments
What is the recommended idiom for checking whether a query returned any results? Example: orgs = Organisation.objects.filter(name__iexact="Fjuk inc") # If any results # Do this with the results without...
  • May 22, 2022
  • 0 Comments