paulocheque / django-dynamic-fixture

A complete library to create dynamic model instances for testing purposes.
http://django-dynamic-fixture.readthedocs.io/
Other
391 stars 67 forks source link

UnsupportedFieldError: PointField [geoDjango] #8

Closed zvictor closed 9 years ago

zvictor commented 12 years ago

Hi,

I realized that DDF has no compatibility with geodjango, more specifically with django.contrib.gis.db.models.fields.PointField. I am interested in implement it, but I don't know how to start. How can we deal with geodjango requirement, and how am I supposed to test the implementation? Any ideas how can we do it?

paulocheque commented 12 years ago

Hi, thanks for reporting.

You can create a method called pointfield_config(self, field, key) in SequentialDataFixture and RandomDataFixture. You can use other methods of this class as example. Tell me if this is enough.

https://github.com/paulocheque/django-dynamic-fixture/blob/master/django_dynamic_fixture/fixture_algorithms/sequential_fixture.py

https://github.com/paulocheque/django-dynamic-fixture/blob/master/django_dynamic_fixture/fixture_algorithms/random_fixture.py

ps: I was a little busy, but I will be back to aprove this pull requests! Thanks again!

paulocheque commented 11 years ago

If you do not want to implement it in the DDF code, you can create it as your Custom Data Fixture: https://github.com/paulocheque/django-dynamic-fixture/wiki/Documentation#wiki-data_fixtures

You can create a class that inherit from some DDF data fixture class.

Regards

paulocheque commented 11 years ago

Oh, I see now you implement it: https://github.com/zvictor/django-dynamic-fixture/commit/c014d15cfc6aa6ee0427b6b4c56cef25aa803c34

Nice.

valberg commented 11 years ago

Is this going to be merged into django-dynamic-fixture?

paulocheque commented 11 years ago

Could you confirm for me if this is compatible with all DDF Django supported versions? Maybe we can let this implementation with optional just for the compatible versions.

manterfield commented 10 years ago

Is this ever getting merged in or is there already some support for geodjango that I've missed?

paulocheque commented 10 years ago

I was waiting for a PR, but I will merge it manually. In the mean time, you can try this: http://django-dynamic-fixture.readthedocs.org/en/latest/data.html#geodjango-fields

paulocheque commented 10 years ago

https://github.com/paulocheque/django-dynamic-fixture/commit/09bc4eeddd9390072e3e5641761ac4a30ace3ab0

paulocheque commented 9 years ago

Added support in 1.8.4 version. Thanks for reporting. Best,