Say I have a model like
class Example (models.Model):
ip = models.IPAddressField()
desc = models.CharField(maxlength=255)
created = models.DateTimeField(auto_now_add=True)
How do I make a query that counts distinct objects by ip (or any other
field that is not pk)? It's quite simple with raw SQL, but is there
some other way of doing this (on MR)?
Documentation is not very helpful on using .distinct(), imho. Some
examples that I found from the mailing lists are from pre-MR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---