Created
June 4, 2009 22:45
-
-
Save lukexi/123910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SiteForm(twf.TableForm): | |
action = 'save_site' | |
children = [ | |
twf.HiddenField('id'), | |
twf.TextField('name', validator=twv.UnicodeString(not_empty=True)), | |
twf.TextField('url', validator=twv.URL(not_empty=True, add_http=True, check_exists=True), | |
label_text="Website URL") | |
] | |
class WebsiteMixin(object): | |
"""Additional methods for a Website object to contain""" | |
@property | |
def edit_form(self): | |
"""An edit form for a website""" | |
site_form = SiteForm('site_form_%d' % self.id) | |
return site_form( | |
self.__dict__ | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment