Benedict Verheyen wrote:
> There are about 7 possible risks types and every risk is coupled to a
> patient. Every patient has a room.
> When i display all the risks of a certain type, i also need the patient
> info and the room, sorted by the room.
> That's why is was trying to get the roomnumber like this:
> risk->patient->room->roomnumber
> 
> As i need it for all the different risks (which are basically risk
> assessement methologies), all of them now have a manager class with a
> function that has the custom sql.
> 
> It doesn't seem like i could do it another way or that it's bad design.

Yes it seems reasonable. From the top of my head I can only suggest 
merging all typed risk tables into one with a field 'type'. But it may 
be bad if different types have different fields...

There is also another approach to sorting -- get all the records from 
the database and sort them in memory. But this of course works only for 
  relatively small amount of records.

--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to