On Mon, Jul 11, 2011 at 10:36 PM, Jonas Geiregat <[email protected]> wrote:
> >
> > results.extra(select={
> > 'distance':
> '(acos(sin(latitude)*sin(%(latitude)f)+cos(latitude)*cos(%(latitude)f)*cos(%(longitude)f-longitude)))'
> % {
> > 'latitude': latitude,
> > 'longitude': longitude
> > }
> > }).order_by('distance')
> >
>
> This is an interesting solution to the issue. I never really looked into
> the extra method.
> So I read the docs and I'm wondering if it wouldn't be better to use the
> select_params parameter ?
>
I havent used this with select_params, but doesnt that require that you type
the same argument couple of times to match the parameters.
I prefer this 'named' parameter list, as it is easy to manage and read. Isnt
it?
-V
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.