1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] python django latitude longitude filter in queryset

Discussão em 'Python' iniciado por Stack, Outubro 3, 2024 às 19:42.

  1. Stack

    Stack Membro Participativo

    I have a field like

    class MyModel(models.Model):
    latitude = models.CharField(max_length=100, db_index=True)
    longitude = models.CharField(max_length=100, db_index=True)


    Lets say I have lat long value like

    myval = (27.66469717424158, 85.30983049711507)


    Here I want to find all the objects in MyModel which are less than 10 KM in distance from myval

    I looked into geopy library. I think it is useful after I get the data from queryset.

    How to achieve this ?

    Continue reading...

Compartilhe esta Página