Hi everyone, I am currently working on django and get confused about how to design the model.
-- Right now, I have a table named 'Reactionmeta' which structure like below:
1 2 3 4 5 6 121 122
reaction name metabolite1 stoichiometry1 metabolite2 stoichiometry2 .......... metabolite60 stoichiometry60 (stoichiometry1 corresponds to metabolite1 and so on so forth)
(P.S: I have to claim that each stoichiometry correspond to one metabolites in the reaction, like a + b -> 2c + d(the number is the stoichiometry)
However, one metabolite may has different stoichiometry, because they may involved in different reactions.
For example: a + 2b + c -> d + e + f; 2a + b -> h + j (metabolite a has different stoichiometry in two reactions)
some of the reactions, contains 2 metabolites, thus this reaction have value in 6 columns and no value from column 7-122.
And some of the reactions contains more than 40 metabolites, so they have values in majority of columns.
My question is, I created the class and registered in the admin.py, and when I clicked on one reaction in adminsite and all the columns are displayed even though some of fields are blank, like below:
In that case, how can only display those fields with values and hide the fields without values? Or is there is any other way to modify the database structure or class structure to display the metabolites and stoichiometry only this reaction involves?
Thank you!!!!
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/22738963-e373-467e-8291-fdb0086be40e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment