Beispiel #1
0
def documentformset_factory(document, form=DocumentForm, formfield_callback=None,
                         formset=BaseDocumentFormSet,
                         dotpath=None, schema=None,
                         extra=1, can_delete=False, can_order=False,
                         max_num=None, fields=None, exclude=None):
    """
    Returns a FormSet class for the given Document class.
    """
    form = documentform_factory(document, form=form, fields=fields, exclude=exclude,
                             dotpath=dotpath, schema=schema,
                             formfield_callback=formfield_callback)
    FormSet = formset_factory(form, formset, extra=extra, max_num=max_num,
                              can_order=can_order, can_delete=can_delete)
    FormSet.document = document
    return FormSet
Beispiel #2
0
 def setUp(self):
     super(FormTestCase, self).setUp()
     self.form_cls = documentform_factory(SimpleDocument)
Beispiel #3
0
 def setUp(self):
     super(FormTestCase, self).setUp()
     self.form_cls = documentform_factory(SimpleDocument)
Beispiel #4
0
 def test_form_for_schema(self):
     form_cls = documentform_factory(SimpleDocument)
Beispiel #5
0
 def test_form_for_schema(self):
     form_cls = documentform_factory(SimpleDocument)