GeoDjango & MySQL: points can't be NULL, what other “empty” value should I use?

后端 未结 3 1505
不思量自难忘°
不思量自难忘° 2021-01-18 09:21

I have this Django model:

from django.contrib.gis.db import models

class Event(models.Model):
    address = models.TextField()
    point = models.PointField         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 09:42

    I just had the same issue. For me, I needed to specify to not make a spatial_index. So your model would change to:

    from django.contrib.gis.db import models
    
    class Event(models.Model):
        address = models.TextField()
        point = models.PointField('coordinates', null=True, blank=True, spatial_index=False)
    

提交回复
热议问题