예제 #1
0
파일: view.py 프로젝트: platipy/Inspire
    def scaffold_form(self):
        """
            Create form from the model.
        """
        converter = self.model_form_converter(self.session, self)
        form_class = form.get_form(
            self.model, converter, only=self.form_columns, exclude=self.excluded_form_columns, field_args=self.form_args
        )

        if self.inline_models:
            form_class = form.contribute_inline(self.session, self.model, form_class, self.inline_models)

        return form_class
예제 #2
0
    def scaffold_form(self):
        """
            Create form from the model.
        """
        converter = self.model_form_converter(self.session, self)
        form_class = form.get_form(self.model, converter,
                          only=self.form_columns,
                          exclude=self.form_excluded_columns,
                          field_args=self.form_args)

        if self.inline_models:
            form_class = self.scaffold_inline_form_models(form_class)

        return form_class