Oct. 12th, 2010

foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
[personal profile] foxfirefey
Let's say I have ColorProperty and DWThemeColor (which is the through of a ManyToMany between DWTheme and ColorProperty). And I want to get all distinct ColorProperties that belong to DWThemes. This is how:

ColorProperty.objects.filter(dwthemecolor__isnull = False).distinct()

You don't even want to know how long it took me to figure this out, people.

Profile

django_dev: The Django logo. (Default)
Developing with Django

April 2014

S M T W T F S
  12345
6789101112
131415161718 19
20212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags