0

I have model shop

shop

class Shop(models.Model):
CATEGORY = (
    ('BookShop', 'Bookshop'),
    ('Bakery', 'Bakery'),
    ('Dairy', 'Dairy'),
Shop_category = models.CharField(max_length=200, null=True, choices=CATEGORY)
Distance = models.PositiveIntegerField(null=True,)
Shop_location = models.PointField(null=True)
I want to set filter on choice field and distance.

 The point field get location of user and calculate distance between shop and user 

 how i can set so that if the distance calculated between shop and user less then are equal to distance given by shop then shop will print and one more condition choice filed it is compulsory to match?
3
  • Please Edit the Question to ask a question. – Vince Jun 1 '20 at 3:30
  • i have edited i want to set the filter where the shop define the distance under which its shop will show user – Sarthak tiwari Jun 1 '20 at 6:24
  • In English, questions contain a question mark ('?'). In GIS SE this is generally framed with a "How can I..." Some attempt should be made to accomplish your goal, and the error or other undesired behavior should be included. It looks like you just stopped coding. – Vince Jun 1 '20 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.