from django import forms
from django.utils import simplejson as json
import staticmedia

class JSONWidget(forms.Textarea):
    def render(self, name, value, attrs=None):
        if value is None:
            value = ""
        if not isinstance(value, basestring):
            value = json.dumps(value, indent=2)
        return super(JSONWidget, self).render(name, value, attrs)


class JSONSelectWidget(forms.SelectMultiple):
    pass

class JSONTableWidget(JSONWidget):
    class Media:
        js = (
            staticmedia.url('js/jquery.js'),
            staticmedia.url('js/jquery.tmpl.js'),
            staticmedia.url('js/json-table.js'),
            staticmedia.url('js/json-table-templates.js'),
        )
from django import forms
from django.utils import simplejson as json
from django.conf import settings

class JSONWidget(forms.Textarea):
    def render(self, name, value, attrs=None):
        if value is None:
            value = ""
        if not isinstance(value, basestring):
            value = json.dumps(value, indent=2)
        return super(JSONWidget, self).render(name, value, attrs)


class JSONSelectWidget(forms.SelectMultiple):
    pass

class JSONTableWidget(JSONWidget):
    class Media:
        js = (
            settings.STATICFILES_URL + 'js/jquery.js',
            settings.STATICFILES_URL + 'js/jquery.tmpl.js',
            settings.STATICFILES_URL + 'js/json-table.js',
            settings.STATICFILES_URL + 'js/json-table-templates.js',
        )
Use staticfiles instead of staticmedia
Use staticfiles instead of staticmedia

  from django import forms
  from django.utils import simplejson as json
- import staticmedia
+ from django.conf import settings
  
  class JSONWidget(forms.Textarea):
      def render(self, name, value, attrs=None):
          if value is None:
              value = ""
          if not isinstance(value, basestring):
              value = json.dumps(value, indent=2)
          return super(JSONWidget, self).render(name, value, attrs)
  
  
  class JSONSelectWidget(forms.SelectMultiple):
      pass
  
  class JSONTableWidget(JSONWidget):
      class Media:
          js = (
-             staticmedia.url('js/jquery.js'),
-             staticmedia.url('js/jquery.tmpl.js'),
-             staticmedia.url('js/json-table.js'),
-             staticmedia.url('js/json-table-templates.js'),
+             settings.STATICFILES_URL + 'js/jquery.js',
+             settings.STATICFILES_URL + 'js/jquery.tmpl.js',
+             settings.STATICFILES_URL + 'js/json-table.js',
+             settings.STATICFILES_URL + 'js/json-table-templates.js',
          )
Use staticfiles instead of staticmedia
## Code Before:
from django import forms
from django.utils import simplejson as json
import staticmedia

class JSONWidget(forms.Textarea):
    def render(self, name, value, attrs=None):
        if value is None:
            value = ""
        if not isinstance(value, basestring):
            value = json.dumps(value, indent=2)
        return super(JSONWidget, self).render(name, value, attrs)


class JSONSelectWidget(forms.SelectMultiple):
    pass

class JSONTableWidget(JSONWidget):
    class Media:
        js = (
            staticmedia.url('js/jquery.js'),
            staticmedia.url('js/jquery.tmpl.js'),
            staticmedia.url('js/json-table.js'),
            staticmedia.url('js/json-table-templates.js'),
        )
## Instruction:
Use staticfiles instead of staticmedia
## Code After:
from django import forms
from django.utils import simplejson as json
from django.conf import settings

class JSONWidget(forms.Textarea):
    def render(self, name, value, attrs=None):
        if value is None:
            value = ""
        if not isinstance(value, basestring):
            value = json.dumps(value, indent=2)
        return super(JSONWidget, self).render(name, value, attrs)


class JSONSelectWidget(forms.SelectMultiple):
    pass

class JSONTableWidget(JSONWidget):
    class Media:
        js = (
            settings.STATICFILES_URL + 'js/jquery.js',
            settings.STATICFILES_URL + 'js/jquery.tmpl.js',
            settings.STATICFILES_URL + 'js/json-table.js',
            settings.STATICFILES_URL + 'js/json-table-templates.js',
        )