> class Property(models.Model):
>
> thing = models.ForeignKey(Thing)
> property_type = models.ForeignKey(PropertyType)
> value = models.CharField(...)
> ...
>
> I want to find, for a given PropertyType, all the Things that are
> lacking any Property of that type.
>
> L
I believe it would be:
Thing.objects.all().exclude(property__property_type__exact =
type).distinct()
-rfd
On Aug 28, 12:24 pm, James Tauber <[EMAIL PROTECTED]> wrote:
> There's another query I want to do that I can't seem to wrap my head
> around at the moment:
>
> Say I have a model where Thin
There's another query I want to do that I can't seem to wrap my head
around at the moment:
Say I have a model where Things have Properties each of a particular
PropertyType. So
class Property(models.Model):
thing = models.ForeignKey(Thing)
property_type = models.ForeignKey(P
3 matches
Mail list logo