Thursday, July 31, 2014

Re: Different choices values for a single field in inherited class

class Color(models.Model):
    red_or_white
= models.CharField(max_length=10, choices=[('red', 'Red'), ('white', 'White')])
    tone
= models.CharField(max_length=32)
 
class Wine(models.Model):
    name
= models.CharField(max_length=255)
    color
= models.ForeignKey(Color)    



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f5769995-3563-40f1-a9aa-8d5a9298cbed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment