Source

Lightning Talks / lightning / talks / forms.py

import floppyforms as forms

from uni_form.helpers import FormHelper, Submit

from talks.models import Talk


class TalkForm(forms.ModelForm):
    class Meta:
        model = Talk
        exclude = ('user',)

    def __init__(self, *args, **kwargs):
        super(TalkForm, self).__init__(*args, **kwargs)
        self.fields['url'].label = 'URL'

    @property
    def helper(self):
        helper = FormHelper()
        submit = Submit('save', 'Save', **{'css_class': 'primary'})
        helper.add_input(submit)
        helper.form_action = ''
        helper.form_method = 'POST'
        return helper