Django הגיאוגרפי הוא אפליקציה שDjango לנהל את הנתונים גיאוגרפיים מנהליים. הוא משתמש בהשתנה Preorder עץ חציית, הניתן על ידי יחידת-mptt https://github.com/django-mptt/django-mptt/
הגיא לא intented להחליף GIS, אבל כדי לנהל את כל המקרים שבם יש לך עצים מנהליים, עם היררכיה נוקשה / עצלנית.
מודלים
- מדינה
- אזור
- מיקום
- AdministrativeAreaType
- מטבע
דוגמאות
& Nbsp; שלוש רמות
& Nbsp; איטליה = Country.objects.get (iso_code = 'IT')
& Nbsp; regione, __ = italy.administrativeareatype_set.get_or_create (name = 'Regione')
& Nbsp; Provincia, __ = italy.administrativeareatype_set.get_or_create (name = 'Provincia',
& Nbsp; הורה = regione)
& Nbsp; Comune, __ = italy.administrativeareatype_set.get_or_create (name = "Comune ',
& Nbsp; הורה = מחוז)
& Nbsp; לאציו, __ = AdministrativeArea.objects.get_or_create (המדינה = איטליה,
& Nbsp; name = "לאציו",
& Nbsp; type = regione)
& Nbsp; roma_provincia, __ = AdministrativeArea.objects.get_or_create (מדינה = איטליה,
& Nbsp; name = 'di Roma Provincia',
& Nbsp; type = Provincia,
& Nbsp; הורה = לאציו)
& Nbsp; roma_comune, __ = AdministrativeArea.objects.get_or_create (מדינה = איטליה,
& Nbsp; name = 'Comune di Roma',
& Nbsp; type = Comune,
& Nbsp; הורה = roma_provincia)
& Nbsp; roma, __ = Location.objects.get_or_create (מדינה = איטליה,
& Nbsp; name = 'רומא',
& Nbsp; type = Location.CITY,
& Nbsp; אזור = roma_comune)
& Nbsp; שתי רמות,
& Nbsp; = Country.objects.get (iso_code = 'אמריקאי')
& Nbsp; מדינה, __ = italy.administrativeareatype_set.get_or_create ('המדינה' name =)
& Nbsp; מחוז, __ = italy.administrativeareatype_set.get_or_create ('קאונטי' name =,
& Nbsp; הורה = מדינה)
& Nbsp; ניו יורק, __ = AdministrativeArea.objects.get_or_create (מדינה =,
& Nbsp; name = 'ניו יורק',
& Nbsp; type = מדינה)
& Nbsp; קולומביה, __ = AdministrativeArea.objects.get_or_create (מדינה =,
& Nbsp; name = 'קולומביה',
& Nbsp; type = מחוז,
& Nbsp; הורה = ניו יורק)
& Nbsp; הדסון, __ = Location.objects.get_or_create (מדינה =,
& Nbsp; name = "הדסון",
& Nbsp; type = Location.CITY,
& Nbsp; אזור = קולומביה,
& Nbsp; is_administrative = True)
דרישות :
- Python
- Django
תגובות לא נמצא