      if match:
          m = re.search(r'^%s$|^%s\s|\s%s\s|\s%s$' % (css_class, css_class,
                                                      css_class, css_class),
                        match.group(1))
          print match.group(1)
          if not m:
              return mark_safe(class_re.sub(match.group(1) + " " + css_class,
                                            html))
      else:
          return mark_safe(html.replace('>', ' class="%s">' % css_class, 1))
 
</s> remove             return self.restore_object(attrs, instance=getattr(self, 'instance', None))
 </s> add             return self.restore_object(attrs, instance=getattr(self, 'object', None)) </s> remove         pass
        # if value in validators.EMPTY_VALUES and self.required:
        #     raise ValidationError(self.error_messages['required'])
 </s> add         if value in validators.EMPTY_VALUES and self.required:
            raise ValidationError(self.error_messages['required']) </s> remove             self._data = self.to_native(self.instance)
 </s> add             self._data = self.to_native(self.object) </s> remove         self.required = not(readonly)
 </s> add         if required is None:
            self.required = not(readonly)
        else:
            assert not readonly, "Cannot set required=True and readonly=True"
            self.required = required </s> remove         self.instance = instance
 </s> add         self.object = instance
      if match:
          m = re.search(r'^%s$|^%s\s|\s%s\s|\s%s$' % (css_class, css_class,
                                                      css_class, css_class),
                        match.group(1))

          if not m:
              return mark_safe(class_re.sub(match.group(1) + " " + css_class,
                                            html))
      else:
          return mark_safe(html.replace('>', ' class="%s">' % css_class, 1))
keep keep keep keep replace keep keep keep keep keep
 Fix some bits of serialization 
rest_framework/templatetags/rest_framework.py