> Does anybody have any experience with this and can give war-stories about > good or bad ways to do this?
I just finished updating an aggregate-rich view and I think it is better to use SQL than messing with filters for most complex things. My basic rule of thumb is to use python functions to aggregate for less than 20 expected rows & SQL beyond that. You can sometimes figure the filter code it to work with the other fields, where, select etc but it is not worth it - you end up with something that is unreadable. The point is not to avoid writing all SQL, it is just to make it simpler in most cases and to fit your performance requirements. Do try to keep it organized/consistent though, if you can. The absolute best thing you can do is write a good test suite. Since the aggregate functions are trickier it will pick up on nuances you might miss with schema changes & should make your testing a little quicker. Also it gives you a performance benchmark, which I've used to change designs on some views. HTH, -rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---