datamade / how-to

šŸ“š Doing all sorts of things, the DataMade way
MIT License
87 stars 12 forks source link

Django GeoMultipleChoiceField plugin #53

Closed jeancochrane closed 4 years ago

jeancochrane commented 4 years ago

Background

So far in two separate client apps (https://github.com/datamade/erikson-edi and https://github.com/datamade/just-spaces/) we've had to implement something I call a "GeoMultipleChoiceField" -- a Django form field and widget that allows the user to select multiple geometries on a map and store foreign keys to those geometries the database.

In Just Spaces I tried a bit harder to modularize this functionality, as you can see in https://github.com/datamade/just-spaces/blob/master/surveys/widgets.py and https://github.com/datamade/just-spaces/blob/2c1b312e6e14692eaccadc272a278a04eb6a4b11/surveys/forms.py#L219-L234, but it's still pretty tightly coupled to the app and I don't think the API design is very good.

Since this is functionality that has come up twice, I think it's a great candidate for an open source library.

Proposal

I propose to develop an open source Django plugin providing a GeoMultipleChoiceField.

Deliverables

A repo and PyPi package for django-geomultiplechoicefield, providing both a form field and a widget for this functionality.

Timeline

Much of the logic here is already done, but it needs to be modularized and the API needs improvement. I think this would take somewhere around 20 hours to finish.

hancush commented 4 years ago

@beamalsky is going to pick this up in December!

beamalsky commented 4 years ago

This is moving at https://github.com/datamade/django-geomultiplechoice

jeancochrane commented 4 years ago

I think this is done! Any further steps we need to take @beamalsky? Perhaps a blog post?

beamalsky commented 4 years ago

I think we can consider this done!

beamalsky commented 4 years ago

And can be tested next time we need this functionality.

jeancochrane commented 4 years ago

Awesome, thanks!