Monday, August 30, 2010

Custom attributes in Django

Hi

Maybe im looking in wrong places or maybe there is no application to
cover functionality of carrying custom/admin defined attributes, or
maybe it isn't even possible.

Use Case could looks like
Defining models

from customr_attr import models

class ObjectWithCustom(models.Model):
name = models.CharField(max_length=30)

o = ObjectWithCustom.objects.create(name='test')
o.custom_attr.create(name='custom_attr', value='value')

>> o.custom_attr
value

>> ObjectWithCustom.objects.filter(custom_attr='value')
[o]

any ideas?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment