Пример #1
0
    def helper(self):
        helper = FormHelper()

        helper.form_id = 'id-payment-form'
        helper.form_class = 'korta-form'
        helper.form_method = 'post'
        helper.form_action = 'submit_payment'

        helper.layout = Layout(
            Fieldset(
                _(u'Payment Information'),
                HTML('{% include "djkorta/cc_types.html" %}'),
                'number',
                Row('expiration_month','expiration_year'),
                'ccv',
            ),
            ButtonHolder(
                Submit('submit', _(u'Checkout'),
                    css_class='button')
            )
        )
        return helper
Пример #2
0
 def standard_layout(self):
     """
     A reasonable generic layout for messages; if uni_form is not installed,
     this will fail silently and return ``None``.
     """
     try:
         from uni_form.helper import FormHelper
         from uni_form.layout import Layout, ButtonHolder, Submit
         helper = FormHelper()
         helper.form_method = "POST"
         helper.layout = Layout(
                     'recipients',
                     'subject',
                     'language',
                     'body',
                     ButtonHolder(
                             Submit('send', 'Send')
                         )
                 )
         return helper
     except ImportError:
         return None