Re: filter on a method

2008-07-20 Thread Malcolm Tredinnick
On Sun, 2008-07-20 at 10:28 +0200, Andre Meyer wrote: > hi all > > it does not seem to be possible to filter on the return value of a > model's method, or is it? No, it isn't. Filtering and sorting are converted to SQL statements and there's no way to write an SQL statement in this fashion. >

Re: filter on a method

2008-07-20 Thread Andre Meyer
hi Malcolm thanks a lot for your explanations. i am much more fluent with Python than SQL, anyway ;-) do you happen to have a good link for a merge-sort-style technique at hand? btw: wrt. merging query sets, i tried this ModelA.objects.filter(parent=None) | ModelB.objects.filter(item=None) bu

Re: filter on a method

2008-07-20 Thread [EMAIL PROTECTED]
It sounds like you want to give each of the models it's own manager. On Jul 20, 3:28 am, "Andre Meyer" <[EMAIL PROTECTED]> wrote: > hi all > > it does not seem to be possible to filter on the return value of a model's > method, or is it? are there alternative ways to achieve this? > > my situatio

filter on a method

2008-07-20 Thread Andre Meyer
hi all it does not seem to be possible to filter on the return value of a model's method, or is it? are there alternative ways to achieve this? my situation is as follows: there is a model with several child models (via model inheritance). i want to retrieve in a single query set all instances (f