2011-09-10 11:04:30 +08:00
|
|
|
from django.contrib.gis.db import models
|
|
|
|
from django.contrib.gis import admin
|
2012-08-12 18:32:08 +08:00
|
|
|
from django.utils.encoding import python_2_unicode_compatible
|
2011-09-10 11:04:30 +08:00
|
|
|
|
2012-08-12 18:32:08 +08:00
|
|
|
@python_2_unicode_compatible
|
2011-09-10 11:04:30 +08:00
|
|
|
class City(models.Model):
|
|
|
|
name = models.CharField(max_length=30)
|
|
|
|
point = models.PointField()
|
|
|
|
objects = models.GeoManager()
|
2013-10-17 16:17:41 +08:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
2011-09-10 11:04:30 +08:00
|
|
|
|
|
|
|
admin.site.register(City, admin.OSMGeoAdmin)
|