src/blog_admin/forms.py
def crispy_init(self): # pragma: no cover
        """Initialize crispy-forms helper."""
        self.helper = FormHelper()
        self.helper.form_id = 'id-PostCreateForm'
        self.helper.form_class = 'form-group'
        self.helper.form_method = 'post'
        self.helper.form_action = reverse('create_post')

        # self.helper.layout = layout.Layout(
        #     layout.Field('title'),
        #     layout.Field('description'),
        #     layout.Field('hashtags'),
        #     layout.Field('content'),
        #     layout.Field('preview_img_url'),
        #     layout.Field('post_status'),
        #     layout.ButtonHolder(
        #         layout.Submit('submit', 'Create post')
        #     )
        # )
        self.helper.layout = layout.Layout(
            layout.Div(
                'title',
                'content',
                layout.ButtonHolder(
                    layout.Button(
                        'next', 'Next page', css_class='btn-outline-dark'
                    )
                ),
                css_class='py-3',
                css_id='form1'
            ),
            layout.Div(
                'description',
                'hashtags',
                'preview_img_url',
                'post_status',
                layout.Row(
                    layout.Div(
                        layout.Button(
                            'back',
                            'Previous page',
                            css_class='btn-outline-dark'
                        ),
                        css_class='col-md-6'
                    ),
                    layout.Div(
                        layout.Submit('submit', 'Create post'),
                        css_class='col-md-6'
                    )
                ),
                css_class='py-3 d-none',
                css_id='form2'
            ),
        )
Initialize crispy-forms helper.
Initialize crispy-forms helper.
Initialize crispy - forms helper .
def crispy_init(self): 
        self.helper = FormHelper()
        self.helper.form_id = 'id-PostCreateForm'
        self.helper.form_class = 'form-group'
        self.helper.form_method = 'post'
        self.helper.form_action = reverse('create_post')
        self.helper.layout = layout.Layout(
            layout.Div(
                'title',
                'content',
                layout.ButtonHolder(
                    layout.Button(
                        'next', 'Next page', css_class='btn-outline-dark'
                    )
                ),
                css_class='py-3',
                css_id='form1'
            ),
            layout.Div(
                'description',
                'hashtags',
                'preview_img_url',
                'post_status',
                layout.Row(
                    layout.Div(
                        layout.Button(
                            'back',
                            'Previous page',
                            css_class='btn-outline-dark'
                        ),
                        css_class='col-md-6'
                    ),
                    layout.Div(
                        layout.Submit('submit', 'Create post'),
                        css_class='col-md-6'
                    )
                ),
                css_class='py-3 d-none',
                css_id='form2'
            ),
        )
def crispy_init ( self ) : self . helper = FormHelper ( ) self . helper . form_id = 'id-PostCreateForm' self . helper . form_class = 'form-group' self . helper . form_method = 'post' self . helper . form_action = reverse ( 'create_post' ) self . helper . layout = layout . Layout ( layout . Div ( 'title' , 'content' , layout . ButtonHolder ( layout . Button ( 'next' , 'Next page' , css_class = 'btn-outline-dark' ) ) , css_class = 'py-3' , css_id = 'form1' ) , layout . Div ( 'description' , 'hashtags' , 'preview_img_url' , 'post_status' , layout . Row ( layout . Div ( layout . Button ( 'back' , 'Previous page' , css_class = 'btn-outline-dark' ) , css_class = 'col-md-6' ) , layout . Div ( layout . Submit ( 'submit' , 'Create post' ) , css_class = 'col-md-6' ) ) , css_class = 'py-3 d-none' , css_id = 'form2' ) , )
Initialize crispy-forms helper.
Initialize crispy - forms helper .
# pragma: no cover """Initialize crispy-forms helper.""" # self.helper.layout = layout.Layout( #     layout.Field('title'), #     layout.Field('description'), #     layout.Field('hashtags'), #     layout.Field('content'), #     layout.Field('preview_img_url'), #     layout.Field('post_status'), #     layout.ButtonHolder( #         layout.Submit('submit', 'Create post') #     ) # )
self