DRF 3.0: widget_html manipulations equivalent?

17 views
Skip to first unread message

Nemesis

unread,
Feb 10, 2015, 6:35:43 AM2/10/15
to django-res...@googlegroups.com
Hi all,

we are porting DRF-gis to DRF 3.0.

One little problem arised, in the previous version I introduced a little improved that enabled the browsable API to show a textarea with nicely indented GeoJSON, which came really handy when testing PUT/PATCH methods.

After this change at the linked line:

https://github.com/djangonauts/django-rest-framework-gis/commit/b93c9a6172bd76005a6a17e81d7e04fc15c0382f#diff-dc41434392d098f7395c9d89d9a000e8L46

We lost the nicely formatted GeoJSON. Also, on python2 we get something like:
{ 'type': u'Feature', 'geometry': { 'type': u'Point', 'coordinates': [0, 0] }}

Notice the u'' of unicode.

This causes annoyances becaue u'' is not valid JSON and raises validation errors.

I looked for a way to accomplish the same goal in DRF 3.0 but I'm not sure it's possible at all.

Any hint?

Federico

Tom Christie

unread,
Feb 10, 2015, 6:37:04 AM2/10/15
to django-res...@googlegroups.com
Hi Federico,

Would you also be able to include before and after screenshots of what you're describing so that it's easier to see the context?

Cheers!

  Tom

Nemesis

unread,
Feb 10, 2015, 7:11:14 AM2/10/15
to django-res...@googlegroups.com

Nemesis

unread,
Feb 12, 2015, 1:07:03 PM2/12/15
to django-res...@googlegroups.com
Was my explaination clear? Any thoughs on this issue?

Thanks
Federico

Tom Christie

unread,
Feb 12, 2015, 4:20:15 PM2/12/15
to django-res...@googlegroups.com
Hi Federico, yup perfectly clear tho I've not had a more in depth look yet. I think it'd be worth filling this one as an issue so we can make sure it gets resolved and doesn't drop off our radar. It may be that we've already got the API you need, but because I've not been looking at the HTML forms lately I can't tell you off the top of my head.

Nemesis

unread,
Feb 13, 2015, 10:37:47 AM2/13/15
to django-res...@googlegroups.com
Thank you Tom,

should I open an issue on github?

Federico

Tom Christie

unread,
Feb 13, 2015, 10:51:46 AM2/13/15
to django-res...@googlegroups.com
Yup

Nemesis

unread,
Feb 16, 2015, 5:38:15 AM2/16/15
to django-res...@googlegroups.com, christ...@gmail.com
Just did it:
https://github.com/tomchristie/django-rest-framework/issues/2561

Thanks Tom


On 02/13/2015 04:51 PM, Tom Christie wrote:
> Yup

Reply all
Reply to author
Forward
0 new messages