Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6335625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:53:38+00:00 2026-05-24T18:53:38+00:00

I make the user interface appear adding integration with facebook and enabling combining a

  • 0

I make the user interface appear adding integration with facebook and enabling combining a search with a category and a location:

enter image description here

This poses some problems to me not only with the facebook integration but also with locations. I don’t fetch the locations from the datastore, I just put them in plain html:

<select name="w" id="searcharea">    
<option value="1" >Entire India</option>            
<option value="2" > Andaman & Nicobar Islands</option>          
<option value="3" > Andhra Pradesh</option>

etc. We see that the option values make no sense: 1,2,3 has no meaning and I just put the numbers there. The records in the datastore can match based on longitude+latitude+radius so for instance an URL like ?lat=-22.45&lon=-43.12&r=294200 is a parametrization that matches Rio de Janeiro with surroundings where the radius is a bit arbitrarily chosen in this case to match Rio de Janeiro and not Sao Paulo. Rounding off the longitudes and latitudes to 2 decimals is also decided as “good enough”. But how do I map between the HTML and the datastore? An HTML option value has only one value and longitude + latitude + radius are three values. I’d like to find a solution that covers everything without needing to add my own geography codes. Longitude, latitude and radius are international standard so naturally I wish to avoid creating my own IDs for locations. I probably could make an algorithm that the value of the option value is one number that decodes to three values for instance the option value 123456789876 would decode to longitude 1234, latitude 5678 and radius 9876. Can you recommend any solution and/or tell me other advantages and disadvantages the possible solutions have? If you want to inspect the website I talk about, you can via this link koolbusiness.com

I’d like to stay “compatible” with other solutions such as geomodel and google maps so also allowing user to select an “administrative area”, a “city”, a “country” in a way compatible with google maps since they already make and update that structure and its contens while I’ve used the python library geomodel to enable a geography for my entities:

class A(GeoModel,search.SearchableModel):      
    primary_image=blobstore.BlobReferenceProperty() 
    postaladress=db.PostalAddressProperty(indexed=False,verbose_name="postaladdress")
    ...

Implementing a basic search with geomodel works:

m=int(self.request.get('r')) if self.request.get('r') else 804670#radius
lat = self.request.get('lat')
lon = self.request.get('lon')
articles = A.proximity_fetch(A.all(),db.GeoPt(lat, lon),max_results=PAGESIZE+1, max_distance=m)
articles = sorted(articles, key=lambda x: x.modified, reverse=True)

But how integrate the view with the backend since the option value only admit a single value? Should I encode 3 values (lon,lat,radius) encoded as a single value? Or some other solution?
Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:53:39+00:00Added an answer on May 24, 2026 at 6:53 pm

    The easiest way to do this would be to define a lookup table in a configuration file in your code. For instance:

    location_map = {
      1: {'name': Rio De Janeiro', 'lat': -22.45, 'long': -43.12, 'radius': 294200},
      # ...
    }
    

    Then, you can simply use the option value as the key you look up the values in the array by. You can also use this array to generate the form field by iterating over it and outputting name/value pairs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to make a graphical user interface application using the language of my
i wonder how you can make an advanced Android User interface where you can
Now that I can make useful user controls in WPF (thanks to this stackoverflow
I used MrEd Designer to make a user interface for a Scheme program. It
I'm trying to make a tabbed user interface using an asp:Panel and the asp:TreeView.
How can I make sure that my applicaiton User Interface is not influenced by
I've already realized some applications with a small graphical user interface. Nothing complex, but
SVG would make the user interface of one of our intranet applications much more
Does anyone know how I can make a program with user interface like BIOS
I need your suggestions how to organize and make a nice, graphical user interface.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.