>> So now for almost all my models i have an extra manager class with a >> custom sql that gets the room number so i can sort on the room number. > > Too much of custom SQL may be an evidence of wrong model design or an > evidence of bad support of this particular usecase in Django. Usually > sorting is made by some intrinsic property of a model and the fact that > many models have to get their info from a related model seems strange. > But it's hard to say if it's right or not without knowing details of > your design.
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. Regards, Benedict --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---