在makemigrations期间还可以,但是当我要在这里进行迁移时,会引发标题异常。
from django.contrib.gis.db import models
class Restaurant(models.Model):
restaurant = models.CharField(max_length=254)
rating = models.FloatField()
type = models.CharField(max_length=254)
cuisines = models.CharField(max_length=254)
cost = models.CharField(max_length=254)
address = models.CharField(max_length=254)
features = models.CharField(max_length=254)
latitude = models.FloatField()
longitude = models.FloatField()
point = models.PointField()
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.restaurant
不仅Pointfield。如果出现了MultiPolygonField,MultiPointField之类的字段,则会引发该异常。