Hallöchen! llanitedave writes:
> [...] > > I guess it's mostly a normalization question. > > And while I was typing out a long explanatory discussion to > enlarge on the problem, I stumbled across the answer. > > I'll need to use a separate table for each sample type to store > its unique set of attributes. > > For example, a fluid sample type might have the fields: volume, > concentration, pH, and expiration date. A soil sample might have > the fields: Clay content, color, grain size, moisture content. > > All sample types will have the common fields sample ID, sample > type, date collected, collector, source, and storage location. > > So I'll need a generic "Sample" table and then related tables for > each sample type. In our nanotech institute, we have already created a samples database with Django. We used an approach very similar to yours: There is the "Sample" model with almost no fields -- more or less, just the sample name. Then, there is a "Process" model with a timestamp, and an M2M relationship with "Sample". And finally, there is a plethora of models derived from "Process" through multi-table inheritace. Etching processes, deposition processes, measurements etc. Even properties inherent to a sample like sample size or sample substate are organised in special processes. Now, the sample's datasheet simply is the list of all related processes, in timestamp order. > The difficulty is that many sample types are still undefined, and > will have to be defined by the individual users. That means > they'll have to have an interface that allows them to create > tables and fields in the database. I suppose I can put together a > form for that which will ensure it gets done in a limited, > consistent and standard way. We haven't thought about this yet, and we won't do this probably. What we *may* implement someday is that the administrator can create new processes without programming. But this still includes restarting the server. On the other hand, we've defined a "general purpose" process with a spreadsheet-like 2D array, and the user can set the column names arbitrarily. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: torsten.bron...@jabber.rwth-aachen.de or http://bronger-jmp.appspot.com -- 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.