foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
[personal profile] foxfirefey posting in [community profile] django_dev
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.
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

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