Fields¶
OSMField¶
- class osm_field.fields.OSMField(*args, **kwargs)¶
Bases: django.db.models.TextField
Parameters: - lat_field (str) – The name of the latitude field. None (and thus standard behavior) by default.
- lon_field (str) – The name of the longitude field. None (and thus standard behavior) by default.
- latitude_field_name¶
The name of the related LatitudeField.
- longitude_field_name¶
The name of the related LongitudeField.
LatitudeField¶
- class osm_field.fields.LatitudeField(*args, **kwargs)¶
Bases: django.db.models.FloatField
The validators parameter will be appended with validate_latitude() if not already present.
- formfield(**kwargs)¶
Returns: A FloatField with max_value 90 and min_value -90.
LongitudeField¶
- class osm_field.fields.LongitudeField(*args, **kwargs)¶
Bases: django.db.models.FloatField
The validators parameter will be appended with validate_longitude() if not already present.
- formfield(**kwargs)¶
Returns: A FloatField with max_value 180 and min_value -180.