ValueError:无法将类型为datetime的对象用于空间查找参数

时间:2018-12-08 10:44:23

标签: python django postgis geodjango

在makemigrations期间还可以,但是当我要在这里进行迁移时,会引发标题异常。

models.py

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之类的字段,则会引发该异常。

0 个答案:

没有答案