Hi, Community

Sometimes an application model include a lot of fields which are just
dictionary values. Example:

class HDD(models.Model):
  form_factor = models.ForeignKey(HDDFF)
  capacity = models.ForeignKey(HDDCap)
  interface = models.ForeignKey(HDDIntf)
...

and so on, where HDDFF, HDDCap and HDDIntf are similar classes.
Abstract class with only one field "name" may be used, so that this
classes could be defined like this:

class HDDFF(DictModel): pass

but it is not as good as something like this:

class HDD(models.Model):
  form_factor = models.DictionaryField()
  capacity = models.DictionaryField()
  interface = models.DictionaryField()

Database tables "hdd_form_factor_dict", "hdd_capacity_dict" and so on
could be created automatically, just like it is done by
ManyToManyField.

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


Reply via email to