2011-09-10 03:04:30 +00:00
|
|
|
from django.contrib.gis import admin
|
2015-02-09 13:19:34 -05:00
|
|
|
from django.contrib.gis.db import models
|
2012-08-12 12:32:08 +02:00
|
|
|
from django.utils.encoding import python_2_unicode_compatible
|
2011-09-10 03:04:30 +00:00
|
|
|
|
2013-11-02 13:12:09 -07:00
|
|
|
|
2012-08-12 12:32:08 +02:00
|
|
|
@python_2_unicode_compatible
|
2011-09-10 03:04:30 +00:00
|
|
|
class City(models.Model):
|
|
|
|
name = models.CharField(max_length=30)
|
|
|
|
point = models.PointField()
|
2014-01-01 11:01:46 +01:00
|
|
|
|
2011-09-10 03:04:30 +00:00
|
|
|
objects = models.GeoManager()
|
2013-10-17 09:17:41 +01:00
|
|
|
|
2014-01-01 11:01:46 +01:00
|
|
|
class Meta:
|
|
|
|
app_label = 'geoadmin'
|
|
|
|
|
2013-10-17 09:17:41 +01:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
2011-09-10 03:04:30 +00:00
|
|
|
|
|
|
|
admin.site.register(City, admin.OSMGeoAdmin)
|