This release is a pre-release and may not be stable for production use.
A Django application which manage administrative geographical data. It use Modified Preorder Tree Traversal, provided by django-mptt https://github.com/django-mptt/django-mptt/
Geo is not intented to replace a GIS, but to manage all the cases where you have administrative trees, with a strict/lazy hierarchy.
Models
Country
Area
Location
AdministrativeAreaType
Currency
Examples
Three levels
italy = Country.objects.get(iso_code='IT') regione, __ = italy.administrativeareatype_set.get_or_create(name='Regione') provincia,__ = italy.administrativeareatype_set.get_or_create(name='Provincia', parent=regione) comune, __= italy.administrativeareatype_set.get_or_create(name='Comune', parent=provincia) lazio, __ = AdministrativeArea.objects.get_or_create(country=italy, name ='Lazio', type=regione) roma_provincia, __ = AdministrativeArea.objects.get_or_create(country=italy, name ='Provincia di Roma', type=provincia, parent=lazio) roma_comune, __ = AdministrativeArea.objects.get_or_create(country=italy, name ='Comune di Roma', type=comune, parent=roma_provincia) roma, __ = Location.objects.get_or_create(country=italy, name ='Roma', type=Location.CITY, area=roma_comune)Two levels,
us = Country.objects.get(iso_code='US') state, __ = italy.administrativeareatype_set.get_or_create(name='State') county,__ = italy.administrativeareatype_set.get_or_create(name='County', parent=state) ny, __ = AdministrativeArea.objects.get_or_create(country=us, name ='New York', type=state) columbia, __ = AdministrativeArea.objects.get_or_create(country=us, name ='Columbia', type=county, parent=ny) hudson, __ = Location.objects.get_or_create(country=us, name ='Hudson', type=Location.CITY, area=columbia, is_administrative=True)
Project links
Project home page: https://github.com/saxix/django-geo
Documentation: http://pypi.python.org/pypi/django-geo/
Download: http://pypi.python.org/pypi/django-geo/
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-geo-0.2.2.dev20120911141653.tar.gz.
File metadata
- Download URL: django-geo-0.2.2.dev20120911141653.tar.gz
- Upload date:
- Size: 258.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de7399eb505ae7d218a8b6b5aef8aab527a3aaf7b6abed17e1ac5205d326bcba
|
|
| MD5 |
4ec261a862579d1f87d28947d1d3a564
|
|
| BLAKE2b-256 |
5ce6263f9310b5b5a2db0b973f0b485ac0b967bb3e6a96206c9106d2ecf90a45
|