33
44from django import forms
55from django .conf import settings
6+ from django .db .models import Q
67from django .forms .util import ErrorList
78from django .forms .fields import email_re
89from django .template .loader import render_to_string
1213from ietf .liaisons .models import LiaisonDetail , Uploads , OutgoingLiaisonApproval , SDOs
1314from ietf .liaisons .utils import IETFHM
1415from ietf .liaisons .widgets import (FromWidget , ReadOnlyWidget , ButtonWidget ,
15- ShowAttachmentsWidget )
16+ ShowAttachmentsWidget , RelatedLiaisonWidget )
1617
1718
1819class LiaisonForm (forms .ModelForm ):
@@ -33,11 +34,13 @@ class LiaisonForm(forms.ModelForm):
3334 require = ['id_attach_title' , 'id_attach_file' ],
3435 required_label = 'title and file' ),
3536 required = False )
37+ related_to = forms .ModelChoiceField (LiaisonDetail .objects .all (), label = u'Related Liaison' , widget = RelatedLiaisonWidget , required = False )
3638
3739 fieldsets = [('From' , ('from_field' , 'replyto' )),
3840 ('To' , ('organization' , 'to_poc' )),
3941 ('Other email addresses' , ('response_contact' , 'technical_contact' , 'cc1' )),
4042 ('Purpose' , ('purpose' , 'purpose_text' , 'deadline_date' )),
43+ ('References' , ('related_to' , )),
4144 ('Liaison Statement' , ('title' , 'body' , 'attachments' )),
4245 ('Add attachment' , ('attach_title' , 'attach_file' , 'attach_button' )),
4346 ]
@@ -318,7 +321,7 @@ class Meta:
318321 model = LiaisonDetail
319322 fields = ('from_raw_body' , 'to_body' , 'to_poc' , 'cc1' , 'last_modified_date' , 'title' ,
320323 'response_contact' , 'technical_contact' , 'purpose_text' , 'body' ,
321- 'deadline_date' , 'purpose' , 'replyto' , )
324+ 'deadline_date' , 'purpose' , 'replyto' , 'related_to' )
322325
323326 def __init__ (self , * args , ** kwargs ):
324327 super (EditLiaisonForm , self ).__init__ (* args , ** kwargs )
0 commit comments