On Sun, Jun 3, 2012 at 4:02 AM, Kalpa Welivitigoda <callka...@gmail.com> wrote: > Hi, > > I want to develop a web based laboratory test reporting system. It > basically involves storing the records of different tests for > different patient and get a print out of the reports. There are around > 100 tests with different fields. > > The flow would be that the user enters a patient id and the tests for > that person appears, then he selects one test and a input form appears > to enter test results. This continues for the other tests as well and > finally a print out is issued and a pdf of the report is generated on > request. > > Since there are around 100 tests (with different fields), do I need to > write separate models and views (to view the data input form) for each > and every one of them or can it be made simpler at least generating > views (because views are generated from some of the fields in the > model) ?
The sticky word above is "simpler". Beyond a hand written model per test, possibilities include programmaticly generating the models, having all possible fields in one model and hiding the ones which are inappropriate for a particular test (see the fields and exclude options for the ModelForm Meta class, IIRC), to having a single test model plus a set of test_field models, having a ForeignKey relation to the test model, and created pointing to a test instance according to the test type. (This last may involve your view creating a form-like object.) So, what do you consider simple. Someone else may have better suggestions. Bill -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.