diff options
author | Magnus Hagander | 2013-07-19 14:40:20 +0000 |
---|---|---|
committer | Magnus Hagander | 2013-07-19 14:40:20 +0000 |
commit | 59701ea9ee7333a062e8684b4d25b00f31225643 (patch) | |
tree | 86a359c99b8b728b9de00243bbf16a72bb48288b /pgcommitfest/commitfest/forms.py | |
parent | 520992c4ab012ee26f4f302b7cc15331e61746ba (diff) |
Make patch creation a separate workflow
Diffstat (limited to 'pgcommitfest/commitfest/forms.py')
-rw-r--r-- | pgcommitfest/commitfest/forms.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pgcommitfest/commitfest/forms.py b/pgcommitfest/commitfest/forms.py index af3bd45..9838ce6 100644 --- a/pgcommitfest/commitfest/forms.py +++ b/pgcommitfest/commitfest/forms.py @@ -5,6 +5,7 @@ from selectable.forms.widgets import AutoCompleteSelectMultipleWidget from models import Patch, MailThread from lookups import UserLookup +from widgets import ThreadPickWidget from ajax import _archivesAPI class PatchForm(forms.ModelForm): @@ -23,6 +24,14 @@ class PatchForm(forms.ModelForm): self.fields['committer'].label_from_instance = lambda x: '%s %s (%s)' % (x.user.first_name, x.user.last_name, x.user.username) +class NewPatchForm(forms.ModelForm): + threadmsgid = forms.CharField(max_length=200, required=True, label='Specify thread msgid', widget=ThreadPickWidget) + patchfile = forms.FileField(allow_empty_file=False, max_length=50000, label='or upload patch file', required=False, help_text='This may be supported sometime in the future, and would then autogenerate a mail to the hackers list. At such a time, the threadmsgid would no longer be required.') + + class Meta: + model = Patch + exclude = ('commitfests', 'mailthreads', 'modified', 'authors', 'reviewers', 'committer', 'wikilink', 'gitlink', ) + def _fetch_thread_choices(patch): for mt in patch.mailthread_set.order_by('-latestmessage'): ti = sorted(_archivesAPI('/message-id.json/%s' % mt.messageid), key=lambda x: x['date'], reverse=True) |