Without getting so complicated, something basic like key-value
models.. e.g.

class Person(models.Model):
  pass

class Key(models.Model):
  name = models.CharField()

class Attribute(models.Model):
  person = models.ForeignKey(Person)
  key = models.ForeignKey(Key)
  value = models.CharField()


Which would then allow your desired filters:

people_with_brown_hair = Person.objects.filter(
    attribute=Attribute.objects.get(key=Key.objects.get(name='hair
color'), value='brown')
)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en.

Reply via email to