How to fix the GeoDjango Tutorial?

I'm trying to do the GeoDjango Tutorial using Sqlite as described here.

When I call the load.py script it stops showing the error:

Failed to save the feature (id: 206) into the model with the keyword arguments:
{'fips': 'UK', 'iso2': 'GB', 'iso3': 'GBR', 'un': 826, 'name': 'United Kingdom'
...
sqlite3.IntegrityError: NOT NULL constraint failed: world_worldborder.mpoly
...
django.db.utils.IntegrityError: NOT NULL constraint failed: world_worldborder.mpoly

Has anyone know this problem's cause? And a way to Django manage the geometry well importing all the data including 'United Kingdom' record?

I'm using:

Upvotes: 0

Views: 155

Answers (1)

I only could handle it setting the mpoly/geom field null=True in the models.py:

mpoly = models.MultiPolygonField(null=True)

It is not a complete solution because at least 'United Kingdom' was ignored. But it was a very good workaround.

I don't think there is a problem in the TM_WORLD_BORDERS-0.3.shp. It seems there is a problem when Django try to generate the SQL.

Upvotes: 0

Related Questions