Esempio n. 1
0
    def helper(self):
        """We call this as a method/property so we don't make the form helper
           a singleton. """

        # instantiate the form helper object
        helper = helpers.FormHelper()

        # add in some input controls (a.k.a. buttons)
        submit = helpers.Submit('submit', 'Search')
        helper.add_input(submit)

        # define the form action
        helper.form_action = reverse('search')
        helper.form_method = 'GET'
        return helper
Esempio n. 2
0
    def helper(self):
        """ We call this as a method/property so we don't make the form helper a singleton. """

        # instantiate the form helper object
        helper = helpers.FormHelper()

        # add in some input controls (a.k.a. buttons)
        submit = helpers.Submit('submit','Submit')
        helper.add_input(submit)
        reset = helpers.Reset('reset','Reset')
        helper.add_input(reset)

        # define the form action
        helper.form_action = reverse('awesome-form-action')
        helper.form_method = 'POST'
        # helper.form_class = 'awesomeness'
        # helper.form_id = 'form-100'
        return helper