Hi!

I'm searching near people in my app. I'm doing it a this way:

37             people = Person.objects.all().exclude(user=request.user)
38
39             near_people = list()
40             for person in people:
41                 if self.is_near(me.coordinates, person.coordinates):
near_people.append(person)

Now, I'm getting all the the Person objects. This is a inefficient way.

The coordinates are latitude/longitude coordinates, so I think in test the
variation and get only latitude +/- 1 and longitude +/- 1 and after this, do
the test exactly (the funcion is_near).

But instead this, can I "draw" a circle and search only Person objects
inside it?

Thanks!

-- 
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx
http://mirblu.com

-- 
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