use*_*162 1 django-profiles geodjango
我是第一次使用django-profiles,所以我可能会遗漏一些基本的东西.
我想创建一个包含地理字段的UserProfile模型.特别是这些方面的东西:
class UserProfile(models.Model):
user = models.OneToOneField(User)
phone = PhoneNumberField()
address = models.CharField(max_length=200)
distance = models.IntegerField()
zone = models.ForeignKey(Hood, null=True, blank=True)
location = models.PointField(srid=900913, null=True, blank=True)
objects = models.GeoManager()
Run Code Online (Sandbox Code Playgroud)
我正在从contrib.gis.db导入模型,并从auth导入通用用户模型.
当我尝试运行syncdb时,我收到以下错误:
AttributeError: 'module' object has no attribute 'PointField'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1591 次 |
| 最近记录: |