Relationship query

If the county query was successful, the district query is performed, and then a relationship attribute (state_ref) is used to find the state within which the county is placed:

        state = county.state_ref

The two-way relationship established in the County, District, and State model definitions make this possible. This state object is a member of the State model class and can be used to retrieve the name of the state.

To create the custom popup, string template formatting is used to populate the popup with the specifics describing the arena requested. The result is assigned to the variable form.popup.

Finally, the populated form is then passed once again to the index.html template, but this time it contains data about the selected ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.