On Feb 1, 11:29 am, Kenneth Gonsalves <law...@au-kbc.org> wrote:
> On Monday 01 Feb 2010 4:03:26 pm James Bennett wrote:
>
> > On Mon, Feb 1, 2010 at 3:59 AM, Kenneth Gonsalves <law...@au-kbc.org> wrote:
> > > Anyway, player.getcoursehandicap() works - but not within 'filter'
>
> > Why would you expect it to? Python method definitions are not legal
> > SQL, so you can't pass a Python method into a SQL query and expect it
> > to work. If you want to further filter the results of a query using
> > Python code, then do it in Python code.
>
> as already mentioned, I am doing it - just hoped that maybe there was a
> shortcut somewhere ...

Maybe you could denormalize a bit, to store the value of
getcoursehandicap() in the Player model and update it on save. Then
you can order on that value in the usual way.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to