Commits

Matthew Schinckel committed f6f8110

Added form_class to pre_validate_data signal.

Comments (0)

Files changed (2)

repose/signals.py

 post_serialize = Signal(providing_args=["request", "response"])
 
 # Enable us to access just before rendering.
-pre_render = Signal(providing_args=["request", "response"])
+pre_render = Signal(providing_args=["request", "response"])
+
+pre_validate_data = Signal(providing_args=["data", "form_class"])
         return result
     
     def pre_serialize(self, data):
+        # TODO Remove the reliance on isinstance().
         if isinstance(data, (QuerySet, list, tuple)):
             return [self.pre_serialize(x) for x in data]
         if isinstance(data, BaseForm):
                 raise http.Forbidden(_(u"You may not view all of the requested data"))
             form = self.form(instance=data)
         else:
-            signals.pre_validate_data.send(sender=self, data=data)
+            signals.pre_validate_data.send(sender=self, data=data, form_class=self.form)
             form = self.form(data)
         
         # Inject links into form.