jsoa/django-formfield — pull request #4 by leetrout (2012-09-11 23:28:14+00:00)
Title: Feat admin

OK- so found out that using the raw JSON field in the admin is glitchy... It runs to_python all the way down the chain and coerces to a string at the end with force_text (see https://github.com/django/django/blob/master/django/forms/widgets.py#L403) which leaves you with text in the textarea that won't parse back into JSON becuase it has the unicode markers.

Anywho- this adds admin.py module that provides a mixin and a convenience class that can be dropped in an app's admin.py to use the new admin widget provided in widgets.py

In our app it looks like:

class RecAdmin(JSONFieldModelAdmin):
list_display = ('__unicode__', 'complete')

Which results in a field that looks like:

Instead of:

I don't know how many people would use your raw field but it's been really handy for us so thought you might want to merge it back to master. If not- no worries. We'll keep our fork ;)