|
@@ -20,13 +20,16 @@ class PydanticFieldList(FieldList):
|
|
|
class PydanticForm(Form):
|
|
class PydanticForm(Form):
|
|
|
_errors = {}
|
|
_errors = {}
|
|
|
_schema = None
|
|
_schema = None
|
|
|
- _baked_instance = None
|
|
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
|
self._errors = {}
|
|
self._errors = {}
|
|
|
self.translator = SchemaToForm(self._schema, self)
|
|
self.translator = SchemaToForm(self._schema, self)
|
|
|
super().__init__(*args, **kwargs)
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
+ @property
|
|
|
|
|
+ def _baked_instance(self):
|
|
|
|
|
+ return self.translator._schema
|
|
|
|
|
+
|
|
|
def process(self, formdata=None, obj=None, data=None, **kwargs):
|
|
def process(self, formdata=None, obj=None, data=None, **kwargs):
|
|
|
super().process()
|
|
super().process()
|
|
|
formdata = self.meta.wrap_formdata(self, formdata)
|
|
formdata = self.meta.wrap_formdata(self, formdata)
|
|
@@ -39,6 +42,7 @@ class PydanticForm(Form):
|
|
|
self.translator.set_errors()
|
|
self.translator.set_errors()
|
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
|
|
+ self.translator.set_baked()
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
def process_obj(self, obj):
|
|
def process_obj(self, obj):
|