Hi.
I have a subclass of Form with some of my own methods in it, what
would be the best way of getting those methods into a ModelForm
subclass.
For example:
class MyForm(forms.Form):
def as_span(self):
“format form in a html span”
return self._html_output(u'<span> %(field)s</span>’, False)
class MyModelForm(forms.ModelForm):
pass
How can I get the as_span method into MyModelForm without writing it
twice?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---