mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-07 10:34:08 +00:00
add missing includes in result fomatting example
This commit is contained in:
@@ -66,6 +66,8 @@ For example, let us extend the result for the status call in text format
|
|||||||
and add the server URL. Such a formatter would look like this:
|
and add the server URL. Such a formatter would look like this:
|
||||||
|
|
||||||
``` python
|
``` python
|
||||||
|
from nominatim_api import StatusResult
|
||||||
|
|
||||||
@dispatch.format_func(StatusResult, 'text')
|
@dispatch.format_func(StatusResult, 'text')
|
||||||
def _format_status_text(result, _):
|
def _format_status_text(result, _):
|
||||||
header = 'Status for server nominatim.openstreetmap.org'
|
header = 'Status for server nominatim.openstreetmap.org'
|
||||||
@@ -86,6 +88,8 @@ as adding formatting functions for all result types using the custom
|
|||||||
format name:
|
format name:
|
||||||
|
|
||||||
``` python
|
``` python
|
||||||
|
from nominatim_api import StatusResult
|
||||||
|
|
||||||
@dispatch.format_func(StatusResult, 'chatty')
|
@dispatch.format_func(StatusResult, 'chatty')
|
||||||
def _format_status_text(result, _):
|
def _format_status_text(result, _):
|
||||||
if result.status:
|
if result.status:
|
||||||
|
|||||||
Reference in New Issue
Block a user