Re: Return SQL calculation within queryset

2012-08-02 Thread Jonathan Baker
No, nott particularly. I'm working on my second Django project, so I suppose I'm still taking the hard road in a few places until I feel more comfortable. I'll keep Geo on my shortlist of apps/frameworks/etc. to check out soon. On Thu, Aug 2, 2012 at 6:01 PM, Melvyn Sopacua wrote: > On 25-7-2012

Re: Return SQL calculation within queryset

2012-08-02 Thread Melvyn Sopacua
On 25-7-2012 2:03, jondbaker wrote: > I've implemented the spherical law of cosines to aid in proximity-based > searching. Is there a specific reason you're not using GeoDjango? Specifically: -- Melvyn Sopacua

Re: Return SQL calculation within queryset

2012-07-27 Thread Jonathan Baker
Thanks for the direction, AT. Below is my final code in case anyone else encounters a similar problem: class LocationManager(models.Manager): ''' ''' def nearby_locations(self, latitude, longitude, proximity, category): ''' ''' cursor = connection.cursor()

Re: Return SQL calculation within queryset

2012-07-25 Thread Andre Terra
Please read the following bits of documentation: https://docs.djangoproject.com/en/dev/topics/db/sql/#performing-raw-sql-queries https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.extra Cheers, AT On Tue, Jul 24, 2012 at 9:03 PM, jondbaker wrote: > I'v

Return SQL calculation within queryset

2012-07-24 Thread jondbaker
I've implemented the spherical law of cosines to aid in proximity-based searching. Everything works correctly, but I'm a bit stumped as to how I can return the calculated distance for a record given that it's not a field in the model. In the Model Manager below, row[1] represents the dynamically