Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to serialize database: __init__() got an unexpected keyword argument 'use_natural_foreign_keys' #65

Open
thecristen opened this issue Nov 26, 2015 · 4 comments

Comments

@thecristen
Copy link

Trying to use the serializer to make use of python manage.py dumpdata --format=geojson find_my_place.County > find_my_place/data/counties.geojson

I have 'djgeojson' in my apps, and i have

SERIALIZATION_MODULES = {
    'geojson' : 'djgeojson.serializers'
}

Django 1.8.7, Python 2.7.10...

@leplatrem
Copy link
Collaborator

Thanks for reporting!

Does it work without the --format argument? I mean, with default json format?

@dennereed
Copy link

I have the same issue and similar configuration.
In settings.py I have

SERIALIZATION_MODULES = {
    'geojson': 'djgeojson.serializers'
}

Django 1.8.4, Python 2.7.6.
Omitting the --format argument successfully produces a json file, but QGIS doesn't recognize it even with a geojson extension.

@leplatrem
Copy link
Collaborator

Don't hesitate to dig in yourself and submit a fix via a pull-request. I cannot spend time on this :(

Actually I don't use this project anymore, and it looks like makinacorpus is still running Django 1.6

@sikmir
Copy link
Contributor

sikmir commented Jan 5, 2018

First of all, Django>=1.8 comes with the built in GeoJSON serializer, so most probably you don't need to use djgeojson at all. What about __init__() got an unexpected keyword argument 'use_natural_foreign_keys' error, the reason is that use_natural_keys option deprecated since Django 1.7 and another new ones introduced: use_natural_foreign_keys and use_natural_primary_keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants