|
1 | | -# Copyright The IETF Trust 2007, All Rights Reserved |
2 | | - |
3 | | -from django.db import models |
4 | | -#from django import newforms as forms |
5 | | -#from sec.drafts.models import InternetDraft |
6 | | -#from sec.drafts.models import Rfc |
7 | | - |
8 | 1 | from ietf.ipr.models import * |
9 | | - |
10 | | -# ------------------------------------------------------------------------ |
11 | | -# Models |
12 | | - |
13 | | -''' |
14 | | -LICENSE_CHOICES = ( |
15 | | - (1, 'a) No License Required for Implementers.'), |
16 | | - (2, 'b) Royalty-Free, Reasonable and Non-Discriminatory License to All Implementers.'), |
17 | | - (3, 'c) Reasonable and Non-Discriminatory License to All Implementers with Possible Royalty/Fee.'), |
18 | | - (4, 'd) Licensing Declaration to be Provided Later (implies a willingness' |
19 | | - ' to commit to the provisions of a), b), or c) above to all implementers;' |
20 | | - ' otherwise, the next option "Unwilling to Commit to the Provisions of' |
21 | | - ' a), b), or c) Above". - must be selected).'), |
22 | | - (5, 'e) Unwilling to Commit to the Provisions of a), b), or c) Above.'), |
23 | | - (6, 'f) See Text Below for Licensing Declaration.'), |
24 | | -) |
25 | | -STDONLY_CHOICES = ( |
26 | | - (0, ""), |
27 | | - (1, "The licensing declaration is limited solely to standards-track IETF documents."), |
28 | | -) |
29 | | -SELECT_CHOICES = ( |
30 | | - (0, 'NO'), |
31 | | - (1, 'YES'), |
32 | | - (2, 'NO'), |
33 | | -) |
34 | | -STATUS_CHOICES = ( |
35 | | - ( 0, "Waiting for approval" ), |
36 | | - ( 1, "Approved and Posted" ), |
37 | | - ( 2, "Rejected by Administrator" ), |
38 | | - ( 3, "Removed by Request" ), |
39 | | -) |
40 | | -# not clear why this has both an ID and selecttype |
41 | | -# Also not clear why a table for "YES" and "NO". |
42 | | -class IprSelecttype(models.Model): |
43 | | - type_id = models.AutoField(primary_key=True) |
44 | | - is_pending = models.IntegerField(unique=True, db_column="selecttype") |
45 | | - type_display = models.CharField(blank=True, max_length=15) |
46 | | - def __str__(self): |
47 | | - return self.type_display |
48 | | - class Meta: |
49 | | - db_table = 'ipr_selecttype' |
50 | | -
|
51 | | -class IprLicensing(models.Model): |
52 | | - licensing_option = models.AutoField(primary_key=True) |
53 | | - value = models.CharField(max_length=255, db_column='licensing_option_value') |
54 | | - def __str__(self): |
55 | | - return self.value; |
56 | | - class Meta: |
57 | | - db_table = 'ipr_licensing' |
58 | | -
|
59 | | -
|
60 | | -class IprDetail(models.Model): |
61 | | - ipr_id = models.AutoField(primary_key=True) |
62 | | - title = models.CharField(blank=True, db_column="document_title", max_length=255) |
63 | | -
|
64 | | - # Legacy information fieldset |
65 | | - legacy_url_0 = models.CharField(blank=True, null=True, db_column="old_ipr_url", max_length=255) |
66 | | - legacy_url_1 = models.CharField(blank=True, null=True, db_column="additional_old_url1", max_length=255) |
67 | | - legacy_title_1 = models.CharField(blank=True, null=True, db_column="additional_old_title1", max_length=255) |
68 | | - legacy_url_2 = models.CharField(blank=True, null=True, db_column="additional_old_url2", max_length=255) |
69 | | - legacy_title_2 = models.CharField(blank=True, null=True, db_column="additional_old_title2", max_length=255) |
70 | | -
|
71 | | - # Patent holder fieldset |
72 | | - legal_name = models.CharField("Legal Name", db_column="p_h_legal_name", max_length=255) |
73 | | -
|
74 | | - # Patent Holder Contact fieldset |
75 | | - # self.contact.filter(contact_type=1) |
76 | | -
|
77 | | - # IETF Contact fieldset |
78 | | - # self.contact.filter(contact_type=3) |
79 | | - |
80 | | - # Related IETF Documents fieldset |
81 | | - rfc_number = models.IntegerField(null=True, editable=False, blank=True) # always NULL |
82 | | - id_document_tag = models.IntegerField(null=True, editable=False, blank=True) # always NULL |
83 | | - other_designations = models.CharField(blank=True, max_length=255) |
84 | | - document_sections = models.TextField("Specific document sections covered", blank=True, max_length=255, db_column='disclouser_identify') |
85 | | -
|
86 | | - # Patent Information fieldset |
87 | | - patents = models.TextField("Patent Applications", db_column="p_applications", max_length=255) |
88 | | - date_applied = models.CharField(max_length=255) |
89 | | - country = models.CharField(max_length=100) |
90 | | - notes = models.TextField("Additional notes", db_column="p_notes", blank=True) |
91 | | - # AMS Change |
92 | | - #is_pending = models.IntegerField("Unpublished Pending Patent Application", blank=True, choices=SELECT_CHOICES, db_column="selecttype") |
93 | | - #is_pending = models.BooleanField(db_column="selecttype") |
94 | | - is_pending = models.CharField(max_length=3,db_column="selecttype") |
95 | | - applies_to_all = models.IntegerField("Applies to all IPR owned by Submitter", blank=True, choices=SELECT_CHOICES, db_column="selectowned") |
96 | | -
|
97 | | - # Licensing Declaration fieldset |
98 | | - #licensing_option = models.ForeignKey(IprLicensing, db_column='licensing_option') |
99 | | - licensing_option = models.IntegerField(null=True, blank=True, choices=LICENSE_CHOICES) |
100 | | - lic_opt_a_sub = models.IntegerField(editable=False, choices=STDONLY_CHOICES) |
101 | | - lic_opt_b_sub = models.IntegerField(editable=False, choices=STDONLY_CHOICES) |
102 | | - lic_opt_c_sub = models.IntegerField(editable=False, choices=STDONLY_CHOICES) |
103 | | - comments = models.TextField("Licensing Comments", blank=True) |
104 | | - lic_checkbox = models.BooleanField("All terms and conditions has been disclosed") |
105 | | -
|
106 | | -
|
107 | | - # Other notes fieldset |
108 | | - other_notes = models.TextField(blank=True) |
109 | | -
|
110 | | - # Generated fields, not part of the submission form |
111 | | - # Hidden fields |
112 | | - third_party = models.BooleanField() |
113 | | - generic = models.BooleanField() |
114 | | - comply = models.BooleanField() |
115 | | -
|
116 | | - status = models.IntegerField(null=True, blank=True, choices=STATUS_CHOICES) |
117 | | - submitted_date = models.DateField(blank=True) |
118 | | - update_notified_date = models.DateField(null=True, blank=True) |
119 | | -
|
120 | | - def __str__(self): |
121 | | - return self.title |
122 | | - def docs(self): |
123 | | - return list(self.drafts.all()) + list(self.rfcs.all()) |
124 | | - def get_absolute_url(self): |
125 | | - return "/ipr/%d/" % self.ipr_id |
126 | | - def get_submitter(self): |
127 | | - try: |
128 | | - return self.contact.get(contact_type=3) |
129 | | - except IprContact.DoesNotExist: |
130 | | - return None |
131 | | - class Meta: |
132 | | - db_table = 'ipr_detail' |
133 | | -
|
134 | | -class IprContact(models.Model): |
135 | | - TYPE_CHOICES = ( |
136 | | - (1, 'Patent Holder Contact'), |
137 | | - (2, 'IETF Participant Contact'), |
138 | | - (3, 'Submitter Contact'), |
139 | | - ) |
140 | | - contact_id = models.AutoField(primary_key=True) |
141 | | - ipr = models.ForeignKey(IprDetail, related_name="contact") |
142 | | - contact_type = models.IntegerField(choices=TYPE_CHOICES) |
143 | | - name = models.CharField(max_length=255) |
144 | | - title = models.CharField(blank=True, max_length=255) |
145 | | - department = models.CharField(blank=True, max_length=255) |
146 | | - address1 = models.CharField(blank=True, max_length=255) |
147 | | - address2 = models.CharField(blank=True, max_length=255) |
148 | | - telephone = models.CharField(max_length=25) |
149 | | - fax = models.CharField(blank=True, max_length=25) |
150 | | - email = models.EmailField(max_length=255) |
151 | | - def __str__(self): |
152 | | - return self.name or '<no name>' |
153 | | - class Meta: |
154 | | - db_table = 'ipr_contacts' |
155 | | -
|
156 | | -
|
157 | | -class IprDraft(models.Model): |
158 | | - ipr = models.ForeignKey(IprDetail, related_name='drafts') |
159 | | - document = models.ForeignKey(InternetDraft, db_column='id_document_tag', related_name="ipr") |
160 | | - revision = models.CharField(max_length=2) |
161 | | - def __str__(self): |
162 | | - return "%s which applies to %s-%s" % ( self.ipr, self.document, self.revision ) |
163 | | - class Meta: |
164 | | - db_table = 'ipr_ids' |
165 | | -
|
166 | | -class IprNotification(models.Model): |
167 | | - ipr = models.ForeignKey(IprDetail) |
168 | | - notification = models.TextField(blank=True) |
169 | | - date_sent = models.DateField(null=True, blank=True) |
170 | | - time_sent = models.CharField(blank=True, max_length=25) |
171 | | - def __str__(self): |
172 | | - return "IPR notification for %s sent %s %s" % (self.ipr, self.date_sent, self.time_sent) |
173 | | - class Meta: |
174 | | - db_table = 'ipr_notifications' |
175 | | -
|
176 | | -class IprRfc(models.Model): |
177 | | - ipr = models.ForeignKey(IprDetail, related_name='rfcs') |
178 | | - document = models.ForeignKey(Rfc, db_column='rfc_number', related_name="ipr") |
179 | | - def __str__(self): |
180 | | - return "%s applies to RFC%04d" % ( self.ipr, self.document_id ) |
181 | | - class Meta: |
182 | | - db_table = 'ipr_rfcs' |
183 | | -
|
184 | | -class IprUpdate(models.Model): |
185 | | - id = models.IntegerField(primary_key=True) |
186 | | - ipr = models.ForeignKey(IprDetail, related_name='updates') |
187 | | - updated = models.ForeignKey(IprDetail, db_column='updated', related_name='updated_by') |
188 | | - status_to_be = models.IntegerField(null=True, blank=True) |
189 | | - processed = models.IntegerField(null=True, blank=True) |
190 | | - class Meta: |
191 | | - db_table = 'ipr_updates' |
192 | | -
|
193 | | -''' |
0 commit comments