# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from __future__ import absolute_import
-
from django.contrib.auth.models import User
from django import forms
from django.db.models import Q
from django.db.utils import ProgrammingError
-from patchwork.models import Patch, State, Bundle, UserProfile
+from patchwork.models import Bundle
+from patchwork.models import Patch
+from patchwork.models import State
+from patchwork.models import UserProfile
class RegistrationForm(forms.Form):
password = forms.CharField(widget=forms.PasswordInput)
+class EmailForm(forms.Form):
+ email = forms.EmailField(max_length=200)
+
+
class BundleForm(forms.ModelForm):
name = forms.RegexField(
regex=r'^[^/]+$', min_length=1, max_length=50, label=u'Name',
bundle_id = forms.IntegerField(widget=forms.HiddenInput)
+class UserProfileForm(forms.ModelForm):
+
+ class Meta:
+ model = UserProfile
+ fields = ['items_per_page']
+
+
def _get_delegate_qs(project, instance=None):
if instance and not project:
project = instance.project
fields = ['state', 'archived', 'delegate']
-class UserProfileForm(forms.ModelForm):
-
- class Meta:
- model = UserProfile
- fields = ['items_per_page']
-
-
class OptionalModelChoiceField(forms.ModelChoiceField):
no_change_choice = ('*', 'no change')
to_field_name = None
if commit:
instance.save()
return instance
-
-
-class EmailForm(forms.Form):
- email = forms.EmailField(max_length=200)