1010# New field classes
1111
1212phone_re = re .compile (r'^\+?[0-9 ]*(\([0-9]+\))?[0-9 -]+$' )
13- class InternationalPhoneNumberField (models .PhoneNumberField ):
13+ class InternationalPhoneNumberField (models .CharField ):
1414 error_message = 'Phone numbers may have a leading "+", and otherwise only contain numbers [0-9], dash, space, and parentheses. '
1515 def validate (self , field_data , all_data ):
1616 if not phone_re .search (field_data ):
@@ -77,38 +77,59 @@ class Admin:
7777
7878class IprDetail (models .Model ):
7979 ipr_id = models .AutoField (primary_key = True )
80- p_h_legal_name = models .CharField ("Legal Name" , maxlength = 255 )
8180 document_title = models .CharField (blank = True , maxlength = 255 )
82- rfc_number = models .IntegerField (null = True , editable = False , blank = True ) # always NULL
83- id_document_tag = models .IntegerField (null = True , editable = False , blank = True ) # always NULL
84- other_designations = models .CharField (blank = True , maxlength = 255 )
85- p_applications = models .TextField (blank = True , maxlength = 255 )
86- date_applied = models .CharField (blank = True , maxlength = 255 )
87- #selecttype = models.ForeignKey(IprSelecttype, to_field='selecttype', db_column='selecttype')
88- selecttype = models .IntegerField (null = True , choices = SELECT_CHOICES )
89- discloser_identify = models .TextField (blank = True , maxlength = 255 , db_column = 'disclouser_identify' )
90- #licensing_option = models.ForeignKey(IprLicensing, db_column='licensing_option')
91- licensing_option = models .IntegerField (null = True , blank = True , choices = LICENSE_CHOICES )
92- other_notes = models .TextField (blank = True )
93- submitted_date = models .DateField (null = True , blank = True )
94- status = models .IntegerField (null = True , blank = True )
95- comments = models .TextField (blank = True )
81+
82+ # Legacy information fieldset
9683 old_ipr_url = models .CharField (blank = True , maxlength = 255 )
9784 additional_old_title1 = models .CharField (blank = True , maxlength = 255 )
9885 additional_old_url1 = models .CharField (blank = True , maxlength = 255 )
9986 additional_old_title2 = models .CharField (blank = True , maxlength = 255 )
10087 additional_old_url2 = models .CharField (blank = True , maxlength = 255 )
88+
89+ # Patent holder fieldset
90+ p_h_legal_name = models .CharField ("Legal Name" , maxlength = 255 )
91+
92+ # Patent Holder Contact fieldset
93+ # self.contacts.filter(contact_type=1)
94+
95+ # IETF Contact fieldset
96+ # self.contacts.filter(contact_type=1)
97+
98+ # Related IETF Documents fieldset
99+ rfc_number = models .IntegerField (null = True , editable = False , blank = True ) # always NULL
100+ id_document_tag = models .IntegerField (null = True , editable = False , blank = True ) # always NULL
101+ other_designations = models .CharField (blank = True , maxlength = 255 )
102+ discloser_identify = models .TextField ("Specific document sections covered" , blank = True , maxlength = 255 , db_column = 'disclouser_identify' )
103+
104+ # Patent Information fieldset
105+ p_applications = models .TextField ("Patent Applications" , blank = True , maxlength = 255 )
106+ date_applied = models .CharField (blank = True , maxlength = 255 )
101107 country = models .CharField (blank = True , maxlength = 100 )
102- p_notes = models .TextField (blank = True )
103- third_party = models .BooleanField (editable = False )
108+ p_notes = models .TextField ("Additional notes" , blank = True )
109+ selecttype = models .IntegerField ("Unpublished Pending Patent Application" , null = True , choices = SELECT_CHOICES )
110+ selectowned = models .IntegerField ("Applies to all IPR owned by Submitter" , null = True , blank = True , choices = SELECT_CHOICES )
111+
112+ # Licensing Declaration fieldset
113+ #licensing_option = models.ForeignKey(IprLicensing, db_column='licensing_option')
114+ licensing_option = models .IntegerField (null = True , blank = True , choices = LICENSE_CHOICES )
104115 lic_opt_a_sub = models .IntegerField (editable = False , choices = STDONLY_CHOICES )
105116 lic_opt_b_sub = models .IntegerField (editable = False , choices = STDONLY_CHOICES )
106117 lic_opt_c_sub = models .IntegerField (editable = False , choices = STDONLY_CHOICES )
107- generic = models .BooleanField (editable = False )
108- selectowned = models .IntegerField (null = True , blank = True , choices = SELECT_CHOICES )
118+ comments = models .TextField ("Licensing Comments" , blank = True )
119+ lic_checkbox = models .BooleanField ("All terms and conditions has been disclosed" )
120+
121+ third_party = models .BooleanField (editable = False )
122+
123+ # Other notes fieldset
124+ other_notes = models .TextField (blank = True )
125+
126+ # Generated fields, not part of the submission form
127+ status = models .IntegerField (null = True , blank = True )
109128 comply = models .BooleanField (editable = False )
110- lic_checkbox = models .BooleanField ()
129+ generic = models .BooleanField (editable = False )
130+ submitted_date = models .DateField (null = True , blank = True )
111131 update_notified_date = models .DateField (null = True , blank = True )
132+
112133 def __str__ (self ):
113134 return self .document_title
114135 def selecttypetext (self ):
@@ -136,8 +157,8 @@ def get_submitter(self):
136157 return self .contact .filter (contact_type = 3 )[0 ]
137158 except :
138159 return None
139- def get_absolute_url (self , item ):
140- return "http://merlot.tools.ietf.org:31415/ ipr/ipr-%s" % ipr_id
160+ def get_absolute_url (self ):
161+ return "/ ipr/ipr-%s" % self . ipr_id
141162 class Meta :
142163 db_table = 'ipr_detail'
143164 class Admin :
@@ -150,16 +171,16 @@ class IprContact(models.Model):
150171 ('3' , 'Submitter Contact' ),
151172 )
152173 contact_id = models .AutoField (primary_key = True )
153- ipr = models .ForeignKey (IprDetail , raw_id_admin = True , editable = False , related_name = "contact" )
154- contact_type = models .IntegerField (editable = False , choices = TYPE_CHOICES )
155- name = models .CharField (maxlength = 255 )
174+ ipr = models .ForeignKey (IprDetail , raw_id_admin = True , edit_inline = True , related_name = "contact" )
175+ contact_type = models .IntegerField (choices = TYPE_CHOICES )
176+ name = models .CharField (maxlength = 255 , core = True )
156177 title = models .CharField (blank = True , maxlength = 255 )
157178 department = models .CharField (blank = True , maxlength = 255 )
158179 address1 = models .CharField (blank = True , maxlength = 255 )
159180 address2 = models .CharField (blank = True , maxlength = 255 )
160- telephone = InternationalPhoneNumberField (maxlength = 25 )
181+ telephone = InternationalPhoneNumberField (maxlength = 25 , core = True )
161182 fax = InternationalPhoneNumberField (blank = True , maxlength = 25 )
162- email = models .EmailField (maxlength = 255 )
183+ email = models .EmailField (maxlength = 255 , core = True )
163184 def __str__ (self ):
164185 return self .name
165186 class Meta :
@@ -170,8 +191,8 @@ class Admin:
170191
171192
172193class IprDraft (models .Model ):
173- document = models .ForeignKey (InternetDraft , db_column = 'id_document_tag' , raw_id_admin = True )
174- ipr = models .ForeignKey (IprDetail , raw_id_admin = True , related_name = 'drafts' )
194+ document = models .ForeignKey (InternetDraft , db_column = 'id_document_tag' , raw_id_admin = True , core = True )
195+ ipr = models .ForeignKey (IprDetail , raw_id_admin = True , edit_inline = True , related_name = 'drafts' )
175196 revision = models .CharField (maxlength = 2 )
176197 def __str__ (self ):
177198 return "%s applies to %s-%s" % ( self .ipr , self .document , self .revision )
@@ -193,8 +214,8 @@ class Admin:
193214 pass
194215
195216class IprRfc (models .Model ):
196- ipr = models .ForeignKey (IprDetail , raw_id_admin = True , related_name = 'rfcs' )
197- rfc_number = models .ForeignKey (Rfc , db_column = 'rfc_number' , raw_id_admin = True )
217+ ipr = models .ForeignKey (IprDetail , edit_inline = True , related_name = 'rfcs' )
218+ rfc_number = models .ForeignKey (Rfc , db_column = 'rfc_number' , raw_id_admin = True , core = True )
198219 def __str__ (self ):
199220 return "%s applies to RFC%04d" % ( self .ipr , self .rfc_number )
200221 class Meta :
0 commit comments