      CONTENT_PARAM = '_content'            # Allow override of body content in form params (allows sending arbitrary content with standard forms) 
      CSRF_PARAM = 'csrfmiddlewaretoken'    # Django's CSRF token used in form params
  
  
      def __new__(cls, request, *args, **kwargs):
          """Make the class callable so it can be used as a Django view."""
          self = object.__new__(cls)
          self.__init__(request)
          return self._handle_request(request, *args, **kwargs)
  
 
</s> remove         self.__init__(request)
        return self._handle_request(request, *args, **kwargs)
 </s> add         if args:
            request = args[0]
            self.__init__(request)
            return self._handle_request(request, *args[1:], **kwargs)
        else:
            self.__init__()
            return self </s> remove     def __init__(self, request):
 </s> add     def __init__(self, request=None): </s> remove     
    def clean_code_url(self):
        """Custom field validation.
        Ensure that code URLs really are valid, and return the content they point to in the cleaned_data,
        rather than returning the URL itself."""
        cleaned_data = self.cleaned_data
        url = cleaned_data.get('code_url')
        if not url:
            return ''

        try:
            http = httplib.Http('.cache')
            resp, content = http.request(url)
        except:
            raise forms.ValidationError('The URL supplied cannot be reached')

        if int(resp.status/100) != 2:
            raise forms.ValidationError('The URL supplied does not return successfully')
        if not content:
            raise forms.ValidationError('The URL supplied returns no content')
        
        return content
        

    def clean(self):
        """Custom form validation.
        Ensure that only one of code_url and code_text is set, and return the content of whichever is set in 'code'."""
        cleaned_data = self.cleaned_data
        code_url = cleaned_data.get('code_url')
        code_text = cleaned_data.get('code_text')

        if not code_url and not code_text:
            raise forms.ValidationError('Either the URL or the code text must be supplied')
        if code_url and code_text:
            raise forms.ValidationError('You may not specify both the URL and the code text')

        if code_url:
            cleaned_data['code'] = code_url
            del cleaned_data['code_url']
        else:
            cleaned_data['code'] = code_text
            del cleaned_data['code_text']

        return cleaned_data
 </s> add  </s> remove .. module:: emitters

 </s> add  </s> remove     This top level resource is used to create  """
 </s> add     This top level resource is used to create highlighted code snippets."""
    def __new__(cls, *args, **kwargs):
      CONTENT_PARAM = '_content'            # Allow override of body content in form params (allows sending arbitrary content with standard forms) 
      CSRF_PARAM = 'csrfmiddlewaretoken'    # Django's CSRF token used in form params
  
  
    def __new__(cls, *args, **kwargs):
          """Make the class callable so it can be used as a Django view."""
          self = object.__new__(cls)
          self.__init__(request)
          return self._handle_request(request, *args, **kwargs)
  
keep keep keep keep replace keep keep keep keep keep
 Minor bit of tidy up (all the stuff I noticed when demoing to francis) 
flywheel/resource.py