Hello,

I am trying to write my first web application{, in django}. And I'm getting 
a little bit stuck on the following point:

I want an application for classify my Wine, which could be red or white. 
Here is the point where I can't manage to 
get on (maybe its not the good way to design a database).

$ less wine/models.py
[...]
class Color(models.Model):
     class Meta:
         abstract = True

    tone = models.CharField(len = 32,  choices = SOMETHING)

class RedColor(Color):
     R_COLORS = (("ligth red", "light red"),
                        ("red", "red"),
                        ("dark red", "dark red"))

      # tell Color() that the SOMETHING must be equals to R_COLORS

class WhiteColor(Color):
      W_COLORS = (("light white", "light white"),
                             ("white", "white"),
                             ("dark white", "dark white"))

      # tell Color() that the SOMETHING must be equals to W_COLORS

In other words I want to have the color class abtract for holding the field 
"tone" because this field is shared between both wine with white and red
color. I also want that, regarding the colors of the wine the user is only 
allowed to perform some slightly change on the colors tones.

My problems are :

   1. I don't know how to translate this into correct Python/Django
   2. I don't know if its a good idea to build the database regarding the 
   value to be stored into

If someone can give me some direction, it will be great !

See u !

PS: I will have the same problem for different tables within the 
application (the light reflection, the grappe variety...)

PPS: I will certainly have the same problems when I will write the same 
kind of application for classifying beers.

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/16d91012-192b-4dd3-a49f-65c753c2acd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to