Backport BaseGeometryWidget and GeometryField on Django < 1.6 #63

Merged
merged 5 commits into from Mar 26, 2014

Conversation

Projects
None yet
2 participants
@gutard
Member

gutard commented Mar 25, 2014

Fix bug #62

@leplatrem

This comment has been minimized.

Show comment
Hide comment
@leplatrem

leplatrem Mar 25, 2014

Collaborator

Oh cool :) Thanks!

Now you should be able to remove this ugly #ifndef :
https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/tests/tests.py#L136

Collaborator

leplatrem commented Mar 25, 2014

Oh cool :) Thanks!

Now you should be able to remove this ugly #ifndef :
https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/tests/tests.py#L136

leaflet/forms/backport.py
+ def render(self, name, value, attrs=None):
+ # If a string reaches here (via a validation error on another
+ # field) then just reconstruct the Geometry.
+ if isinstance(value, basestring):

This comment has been minimized.

@leplatrem

leplatrem Mar 26, 2014

Collaborator

Maybe isinstance(value, six.string_types) ?

django.utils.six comes with Django 1.5

otherwise use this trick : https://github.com/spiral-project/daybed/blob/dev/setup.py#L62-L63

@leplatrem

leplatrem Mar 26, 2014

Collaborator

Maybe isinstance(value, six.string_types) ?

django.utils.six comes with Django 1.5

otherwise use this trick : https://github.com/spiral-project/daybed/blob/dev/setup.py#L62-L63

This comment has been minimized.

@gutard

gutard Mar 26, 2014

Member

I thought python 3 was not officially supported by django 1.5.x and django.utils.six was not available in django 1.4.x. I was (partially) wrong. Actually, django.utils.six comes with django 1.4.2. Is it ok for you to not support django 1.4 and 1.4.1 ?

@gutard

gutard Mar 26, 2014

Member

I thought python 3 was not officially supported by django 1.5.x and django.utils.six was not available in django 1.4.x. I was (partially) wrong. Actually, django.utils.six comes with django 1.4.2. Is it ok for you to not support django 1.4 and 1.4.1 ?

@leplatrem

This comment has been minimized.

Show comment
Hide comment
@leplatrem

leplatrem Mar 26, 2014

Collaborator

Great :) No problem to drop support of Django 1.4 and 1.4.1 for Leaflet forms !

Thanks!

Collaborator

leplatrem commented Mar 26, 2014

Great :) No problem to drop support of Django 1.4 and 1.4.1 for Leaflet forms !

Thanks!

leplatrem added a commit that referenced this pull request Mar 26, 2014

Merge pull request #63 from gutard/geometry_forms_backport
Backport BaseGeometryWidget and GeometryField on Django < 1.6

@leplatrem leplatrem merged commit 798bee2 into makinacorpus:master Mar 26, 2014

1 check passed

default The Travis CI build passed
Details

@gutard gutard deleted the gutard:geometry_forms_backport branch Mar 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment