Skip to content

Commit 6829830

Browse files
committed
Name changes for IprDetail model fields.
- Legacy-Id: 477
1 parent 92968fa commit 6829830

5 files changed

Lines changed: 43 additions & 63 deletions

File tree

ietf/ipr/models.py

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@
2323
("1", 'YES'),
2424
("2", 'NO'),
2525
)
26-
26+
STATUS_CHOICES = (
27+
( 0, "Waiting for approval" ),
28+
( 1, "Approved and Posted" ),
29+
( 2, "Rejected by Administrator" ),
30+
( 3, "Removed by Request" ),
31+
)
2732
# not clear why this has both an ID and selecttype
2833
# Also not clear why a table for "YES" and "NO".
2934
class IprSelecttype(models.Model):
3035
type_id = models.AutoField(primary_key=True)
31-
selecttype = models.IntegerField(unique=True)
36+
is_pending = models.IntegerField(unique=True, db_column="selecttype")
3237
type_display = models.CharField(blank=True, maxlength=15)
3338
def __str__(self):
3439
return self.type_display
@@ -50,14 +55,14 @@ class Admin:
5055

5156
class IprDetail(models.Model):
5257
ipr_id = models.AutoField(primary_key=True)
53-
document_title = models.CharField(blank=True, maxlength=255)
58+
title = models.CharField(blank=True, db_column="document_title", maxlength=255)
5459

5560
# Legacy information fieldset
56-
old_ipr_url = models.CharField(blank=True, maxlength=255)
57-
additional_old_title1 = models.CharField(blank=True, maxlength=255)
58-
additional_old_url1 = models.CharField(blank=True, maxlength=255)
59-
additional_old_title2 = models.CharField(blank=True, maxlength=255)
60-
additional_old_url2 = models.CharField(blank=True, maxlength=255)
61+
legacy_url_0 = models.CharField(blank=True, db_column="old_ipr_url", maxlength=255)
62+
legacy_url_1 = models.CharField(blank=True, db_column="additional_old_url1", maxlength=255)
63+
legacy_title_1 = models.CharField(blank=True, db_column="additional_old_title1", maxlength=255)
64+
legacy_url_2 = models.CharField(blank=True, db_column="additional_old_url2", maxlength=255)
65+
legacy_title_2 = models.CharField(blank=True, db_column="additional_old_title2", maxlength=255)
6166

6267
# Patent holder fieldset
6368
legal_name = models.CharField("Legal Name", db_column="p_h_legal_name", maxlength=255)
@@ -72,15 +77,15 @@ class IprDetail(models.Model):
7277
rfc_number = models.IntegerField(null=True, editable=False, blank=True) # always NULL
7378
id_document_tag = models.IntegerField(null=True, editable=False, blank=True) # always NULL
7479
other_designations = models.CharField(blank=True, maxlength=255)
75-
discloser_identify = models.TextField("Specific document sections covered", blank=True, maxlength=255, db_column='disclouser_identify')
80+
document_sections = models.TextField("Specific document sections covered", blank=True, maxlength=255, db_column='disclouser_identify')
7681

7782
# Patent Information fieldset
78-
p_applications = models.TextField("Patent Applications", maxlength=255)
83+
patents = models.TextField("Patent Applications", db_column="p_applications", maxlength=255)
7984
date_applied = models.CharField(maxlength=255)
8085
country = models.CharField(maxlength=100)
81-
p_notes = models.TextField("Additional notes", blank=True)
82-
selecttype = models.IntegerField("Unpublished Pending Patent Application", blank=True, choices=SELECT_CHOICES)
83-
selectowned = models.IntegerField("Applies to all IPR owned by Submitter", blank=True, choices=SELECT_CHOICES)
86+
notes = models.TextField("Additional notes", db_column="p_notes", blank=True)
87+
is_pending = models.IntegerField("Unpublished Pending Patent Application", blank=True, choices=SELECT_CHOICES, db_column="selecttype")
88+
applies_to_all = models.IntegerField("Applies to all IPR owned by Submitter", blank=True, choices=SELECT_CHOICES, db_column="selectowned")
8489

8590
# Licensing Declaration fieldset
8691
#licensing_option = models.ForeignKey(IprLicensing, db_column='licensing_option')
@@ -101,37 +106,12 @@ class IprDetail(models.Model):
101106
generic = models.BooleanField()
102107
comply = models.BooleanField()
103108

104-
status = models.IntegerField(null=True, blank=True)
109+
status = models.IntegerField(null=True, blank=True, choices=STATUS_CHOICES)
105110
submitted_date = models.DateField(blank=True)
106111
update_notified_date = models.DateField(null=True, blank=True)
107112

108113
def __str__(self):
109114
return self.document_title
110-
def selecttypetext(self):
111-
if self.selecttype == "1":
112-
return "YES"
113-
else:
114-
return "NO"
115-
def selectownedtext(self):
116-
if self.selectowned == "1":
117-
return "YES"
118-
else:
119-
return "NO"
120-
# def get_patent_holder_contact(self):
121-
# try:
122-
# return self.contact.filter(contact_type=1)[0]
123-
# except:
124-
# return None
125-
# def get_ietf_contact(self):
126-
# try:
127-
# return self.contact.filter(contact_type=2)[0]
128-
# except:
129-
# return None
130-
# def get_submitter(self):
131-
# try:
132-
# return self.contact.filter(contact_type=3)[0]
133-
# except:
134-
# return None
135115
def get_absolute_url(self):
136116
return "/ipr/ipr-%s" % self.ipr_id
137117
class Meta:

ietf/ipr/view_new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
def ipr_detail_form_callback(field, **kwargs):
1818
if field.name == "licensing_option":
1919
return forms.IntegerField(widget=forms.RadioSelect(choices=models.LICENSE_CHOICES), required=True)
20-
if field.name in ["selecttype", "selectowned"]:
20+
if field.name in ["is_pending", "applies_to_all"]:
2121
return forms.IntegerField(widget=forms.RadioSelect(choices=((1, "YES"), (2, "NO"))), required=False)
2222
if field.name in ["rfc_number", "id_document_tag"]:
2323
log(field.name)

ietf/ipr/views.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ def show(request, ipr_id=None):
6060
raise KeyError("Unexpected contact_type (%s) in ipr_contacts for ipr_id=%s" % (contact.contact_type, ipr.ipr_id))
6161
# do escaping and line-breaking here instead of in the template,
6262
# so that we can use the template for the form display, too.
63-
ipr.p_notes = linebreaks(escape(ipr.p_notes))
64-
ipr.discloser_identify = linebreaks(escape(ipr.discloser_identify))
63+
ipr.notes = linebreaks(escape(ipr.notes))
64+
ipr.document_sections = linebreaks(escape(ipr.document_sections))
6565
ipr.comments = linebreaks(escape(ipr.comments))
6666
ipr.other_notes = linebreaks(escape(ipr.other_notes))
6767

6868
if ipr.licensing_option:
6969
ipr.licensing_option = dict(LICENSE_CHOICES)[ipr.licensing_option]
70-
if ipr.selecttype:
71-
ipr.selecttype = dict(SELECT_CHOICES)[ipr.selecttype]
72-
if ipr.selectowned:
73-
ipr.selectowned = dict(SELECT_CHOICES)[ipr.selectowned]
70+
if ipr.is_pending:
71+
ipr.is_pending = dict(SELECT_CHOICES)[ipr.is_pending]
72+
if ipr.applies_to_all:
73+
ipr.applies_to_all = dict(SELECT_CHOICES)[ipr.applies_to_all]
7474
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list})
7575

7676
def update(request, ipr_id=None):
@@ -224,7 +224,7 @@ def form(request):
224224
# ---- Helper functions ------------------------------------------------------
225225

226226
def get_section_list(ipr):
227-
if ipr.old_ipr_url:
227+
if ipr.legacy_url_0:
228228
return section_table["legacy"]
229229
elif ipr.generic:
230230
#assert not ipr.third_party

ietf/templates/ipr/details.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h3>{{ ipr.document_title }}</h3>
3232
Sections {% block legacy_sections %}I, II, and IV{% endblock %} of "The Patent Disclosure and Licensing Declaration Template
3333
for {{ section_list.disclosure_type }} IPR Disclosures" have been completed for this IPR disclosure.
3434
Additional information may be available in the original submission.<br>
35-
See the <a href="{{ ipr.old_ipr_url }}">content of the original IPR disclosure</a>.<br>
35+
See the <a href="{{ ipr.legacy_url_0 }}">content of the original IPR disclosure</a>.<br>
3636
</font>
3737
{% endif %}
3838
{% if section_list.new_intro %}
@@ -41,12 +41,12 @@ <h3>{{ ipr.document_title }}</h3>
4141
information are displayed.</font><br>
4242
{% endif %}
4343
{% if section_list.new_intro or section_list.legacy_intro %}
44-
{% if ipr.additional_old_title1 %}
45-
<font size="3"><a href="{{ ipr.additional_old_url1 }}">{{ ipr.additional_old_title1 }}</a></font><br>
44+
{% if ipr.legacy_title_1 %}
45+
<font size="3"><a href="{{ ipr.legacy_url_1 }}">{{ ipr.legacy_title_1 }}</a></font><br>
4646
{% endif %}
4747

48-
{% if ipr.additional_old_title2 %}
49-
<font size="3"><a href="{{ ipr.additional_old_url2 }}">{{ ipr.additional_old_title2 }}</a></font><br>
48+
{% if ipr.legacy_title_2 %}
49+
<font size="3"><a href="{{ ipr.legacy_url_2 }}">{{ ipr.legacy_title_2 }}</a></font><br>
5050
{% endif %}
5151

5252
{% for item in ipr.updates.all %}
@@ -286,26 +286,26 @@ <h4 class="ipr">The Patent Disclosure and Licensing Declaration Template for {{
286286
applications required to be disclosed by Section 6 of RFC 3979)
287287
</th>
288288
</tr>
289-
{% if ipr.p_applications or ipr.p_notes %}
289+
{% if ipr.patents or ipr.notes %}
290290
<tbody class="{% cycle row_parity %}">
291291
<tr>
292292
<td colspan="2"><i>
293293
A. For granted patents or published pending patent applications,
294294
please provide the following information:</i></td>
295295
</tr>
296296
<tr><td class="fixwidth">Patent, Serial, Publication, Registration,
297-
or Application/File number(s): </td><td><b>{{ ipr.p_applications }}</b></td></tr>
297+
or Application/File number(s): </td><td><b>{{ ipr.patents }}</b></td></tr>
298298
</tbody>
299299
<tr class="{% cycle row_parity %}"><td>Date(s) granted or applied for: </td><td><b>{{ ipr.date_applied }}</b></td></tr>
300300
<tr class="{% cycle row_parity %}"><td>Country: </td><td><b>{{ ipr.country }}</b></td></tr>
301-
<tr class="{% cycle row_parity %}"><td>Additional Notes: </td><td><b>{{ ipr.p_notes }}</b></td></tr>
301+
<tr class="{% cycle row_parity %}"><td>Additional Notes: </td><td><b>{{ ipr.notes }}</b></td></tr>
302302
<tr class="{% cycle row_parity %}">
303303
<td colspan="2">
304304
<i>
305305
B. Does this disclosure relate to an unpublished pending patent
306306
application?:
307307
</i>
308-
<b>{{ ipr.selecttype }}</b>
308+
<b>{{ ipr.is_pending }}</b>
309309
</td>
310310
</tr>
311311
<tbody class="{% cycle row_parity %}">
@@ -315,7 +315,7 @@ <h4 class="ipr">The Patent Disclosure and Licensing Declaration Template for {{
315315
<i>C. Does this disclosure apply to all IPR owned by
316316
the submitter?:
317317
</i>
318-
<b>{{ ipr.selectowned }}</b>
318+
<b>{{ ipr.applies_to_all }}</b>
319319
</td>
320320
</tr>
321321
{% else %}
@@ -329,8 +329,8 @@ <h4 class="ipr">The Patent Disclosure and Licensing Declaration Template for {{
329329
covered:</i>
330330
</td>
331331
</tr>
332-
{% if ipr.discloser_identify %}
333-
<tr class="{% cycle row_parity %}"><td class="fixwidth"></td><td><b>{{ ipr.discloser_identify }}</b></td></tr>
332+
{% if ipr.document_sections %}
333+
<tr class="{% cycle row_parity %}"><td class="fixwidth"></td><td><b>{{ ipr.document_sections }}</b></td></tr>
334334
{% else %}
335335
<tr class="{% cycle row_parity %}"><td class="fixwidth"></td><td></span><i>No information submitted</i></td></tr>
336336
{% endif %}

ietf/templates/ipr/list_item.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@
2222
</td>
2323
</tr>
2424
{% ifequal ipr.status 1 %}
25-
{% if ipr.additional_old_title1 %}
25+
{% if ipr.legacy_title_1 %}
2626
<tr>
2727
<td></td>
2828
<td></td>
2929
<td>
3030
<b>*</b>
31-
<a href="{{ ipr.additional_old_url1 }}">{{ ipr.additional_old_title1 }}</a>
31+
<a href="{{ ipr.legacy_url_1 }}">{{ ipr.legacy_title_1 }}</a>
3232
</td>
3333
</tr>
3434
{% endif %}
35-
{% if ipr.additional_old_title2 %}
35+
{% if ipr.legacy_title_2 %}
3636
<tr>
3737
<td></td>
3838
<td></td>
3939
<td>
4040
<b>*</b>
41-
<a href="{{ ipr.additional_old_url2 }}">{{ ipr.additional_old_title2 }}</a>
41+
<a href="{{ ipr.legacy_url_2 }}">{{ ipr.legacy_title_2 }}</a>
4242
</td>
4343
</tr>
4444
{% endif %}

0 commit comments

Comments
 (0)