django-geojson
django-geojson copied to clipboard
Problem using serializer with Dumpdata
When I run dumpdata with geojson it doesn't detect any features.
Looked into it a bit and dumpdata passes a generator object to the serialize methods, and this serializer seems to expect queryset-like objects.
It should work with lists, but indeed, not sure with generators... https://github.com/makinacorpus/django-geojson/blob/master/djgeojson/serializers.py#L346-L347
Instead of isinstance(queryset, list), we could check something like hasattr(queryset, '__iter__'). Don't hesitate to open a pull-request !
Leaving this here as a reference for how dumpdata calls the serializers https://github.com/django/django/blob/master/django/core/management/commands/dumpdata.py#L139 https://github.com/django/django/blob/master/django/core/management/commands/dumpdata.py#L160