Hi

For what i understand of your problem, you are calling tag the fields of a Model called Sample. From, what you say, it is not possible to say a lot of things, but it appear that you will have others models, such as Diseases, Country, ....

You will need to relate the models with foreignkey fields (one to Many ).

However, it seems to me that you need to work a little bit on the formalisation of your problem. In fact, you should be able to build the relationship diagram of your application before any programming step. Once you learn how to ask to yourself the good questions, you'll see that the conception of the django models is easy.


Thierry


Le 28 mars 2010 à 03:28, Daniel <unagimiy...@gmail.com> a écrit :

Hi all,

I'd appreciate it if you could help me out with something.

I am trying to build a way to use faceted browsing through a database
of biological samples.

what I want to model is this:

Sample 1
    race = white
    age = adult
    gene = XCFR2
    disease = cancer
Sample 2
    race = white
    age = child
    gene = 343GS
    disease = stroke
    date = 2010
    country = Netherlands

So each sample could contain many tags.  And each tag should have one
value at a time.  A tag is a category (like race, age, gene, disease),
and a value is for lack of a better word, the choice or free text that
is entered to the right of the ='s sign.  TAG = race, then value =
white

So  does each sample have a many to many relationship with tags?  And
then tags have a many to many relationship with values?

Each sample can have many tags (race, age, gene, disease, ...etc).
Each tag can have many diff values (race could be white, black,
hispanic, asian, etc...) BUT only one at a time
Each value should be mapped to one tag at a time.  But I guess a value
could be reused, like the value XCFR2 could be a valid in gene = XCFR2
and discovered_information = XCFR2.

I think I'm making it too hard, but if someone can help, I would be
happy

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


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

Reply via email to