Ticket #4652: test.py
File test.py, 404 bytes (added by , 17 years ago) |
---|
Line | |
---|---|
1 | #!/usr/bin/python |
2 | # -*- coding: utf-8 -*- |
3 | |
4 | from django import newforms as forms |
5 | |
6 | class RegisterForm(forms.Form): |
7 | homepage = forms.URLField(required=False, verify_exists=False, initial='http://') |
8 | |
9 | def clean_homepage(self): |
10 | field_data = self.clean_data['homepage'] |
11 | if not field_data or field_data == 'http://': |
12 | return '' |
13 | else: |
14 | return field_data |