-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
'Serializer' object has no attribute 'deserialize' #87
Comments
The documentation looks wrong. And i'm not sure the From looking through the tests, I'd say that you would need to do something like: >>> from django.core import serializers
>>> serializers.deserialize('geojson', your_geojson) Can you tell me if this works? Thanks. |
I ran into the same error as @easherma when trying to de-serialize some GeoJSON that was returned from a geocoder API. I tried @Gagaro's suggestion but it resulted in a different error:
That's a pity. So far as I can tell there's no other library that will attempt to nicely convert some valid GeoJSON into a spatially aware Django model. Luckily I'm working with points so it's pretty easy to just parse them out from the JSON. But such a thing could be useful for more complex feature collections. |
The thing is we do have a deserializer in the tests: https://github.com/makinacorpus/django-geojson/blob/master/djgeojson/tests.py#L69-L131 We also have a I'm not sure what's up with all this. |
I haven't been able to use the Deserializer class. Will keep trying though. This part of the documentation is wrong, probably outdated right? |
Would be nice to at least fix the docs. This was my first experience of using the whole makinacorpus Geodjango stack and it didn't inspire immediate confidence! |
It seems to be that was never implemented |
Thanks for this project. I'm playing around with importing it in the django shell to see how deserialization works on my data.
However, I get
'Serializer' object has no attribute 'deserialize'
if I try to importDoes this method not exist if I'm running from shell? The documentation is unclear to me.
The text was updated successfully, but these errors were encountered: