Fixes Ticket #1626. Cleanup legacy IPR models. Commit ready for merge.
- Legacy-Id: 9330
This commit is contained in:
parent
9c9ac7ea3a
commit
415d0ad7c7
|
@ -495,9 +495,9 @@ class Document(DocumentInfo):
|
|||
"""Returns the IPR disclosures against this document and those documents this
|
||||
document directly or indirectly obsoletes or replaces
|
||||
"""
|
||||
from ietf.ipr.models import IprDocAlias
|
||||
aliases = IprDocAlias.objects.filter(doc_alias__in=list(self.docalias_set.all())+self.all_related_that_doc(['obs','replaces'])).filter(ipr__status__in=[1,3]).values_list('ipr', flat=True).distinct()
|
||||
return aliases
|
||||
from ietf.ipr.models import IprDocRel
|
||||
iprs = IprDocRel.objects.filter(document__in=list(self.docalias_set.all())+self.all_related_that_doc(['obs','replaces'])).filter(disclosure__state__in=['posted','removed']).values_list('disclosure', flat=True).distinct()
|
||||
return iprs
|
||||
|
||||
def future_presentations(self):
|
||||
""" returns related SessionPresentation objects for meetings that
|
||||
|
|
|
@ -47,7 +47,6 @@ from ietf.doc.models import ( Document, DocAlias, State, RelatedDocument, DocEve
|
|||
from ietf.doc.expire import expirable_draft
|
||||
from ietf.group.models import Group
|
||||
from ietf.idindex.index import active_drafts_index_by_group
|
||||
from ietf.ipr.models import IprDocAlias
|
||||
from ietf.name.models import DocTagName, DocTypeName, StreamName
|
||||
from ietf.person.models import Person
|
||||
from ietf.utils.draft_search import normalize_draftname
|
||||
|
@ -136,41 +135,6 @@ def fill_in_search_attributes(docs):
|
|||
for e in DocEvent.objects.filter(doc__in=doc_ids, type__in=event_types).order_by('time'):
|
||||
docs_dict[e.doc_id].latest_event_cache[e.type] = e
|
||||
|
||||
# IPR
|
||||
for d in docs:
|
||||
d.iprs = []
|
||||
|
||||
# Consider reworking the following block using all_relations_that_doc? That might simplify the final assembly
|
||||
# down to the code at "if a not in docs_dict"...
|
||||
|
||||
rel_docs = []
|
||||
rel_id_camefrom = {}
|
||||
for d in docs:
|
||||
if isinstance(d,DocAlias):
|
||||
d = d.document
|
||||
rel_this_doc = d.all_related_that_doc(['replaces','obs'])
|
||||
for rel in rel_this_doc:
|
||||
rel_id_camefrom.setdefault(rel.document.pk,[]).append(d.pk)
|
||||
rel_docs += [x.document for x in rel_this_doc]
|
||||
|
||||
ipr_docaliases = IprDocAlias.objects.filter(doc_alias__document__in=doc_ids, ipr__status__in=[1,3]).select_related('doc_alias')
|
||||
for a in ipr_docaliases:
|
||||
if a.ipr not in docs_dict[a.doc_alias.document_id].iprs:
|
||||
docs_dict[a.doc_alias.document_id].iprs.append(a.ipr)
|
||||
|
||||
rel_docs_dict = dict((d.pk, d) for d in rel_docs)
|
||||
rel_doc_ids = rel_docs_dict.keys()
|
||||
rel_ipr_docaliases = IprDocAlias.objects.filter(doc_alias__document__in=rel_doc_ids, ipr__status__in=[1,3]).select_related('doc_alias')
|
||||
for a in rel_ipr_docaliases:
|
||||
if a.doc_alias.document_id in rel_id_camefrom:
|
||||
for k in rel_id_camefrom[a.doc_alias.document_id]:
|
||||
if a.ipr not in docs_dict[k].iprs:
|
||||
docs_dict[k].iprs.append(a.ipr)
|
||||
|
||||
# Clean up, make sure these temporary variables aren't used later
|
||||
# (so we can re-work the code in due time):
|
||||
del rel_docs, rel_id_camefrom, rel_docs_dict, rel_doc_ids, rel_ipr_docaliases
|
||||
|
||||
# telechat date, can't do this with above query as we need to get TelechatDocEvents out
|
||||
seen = set()
|
||||
for e in TelechatDocEvent.objects.filter(doc__in=doc_ids, type="scheduled_for_telechat").order_by('-time'):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from django import forms
|
||||
from django.contrib import admin
|
||||
from ietf.name.models import DocRelationshipName
|
||||
from ietf.ipr.models import (IprNotification, IprDisclosureBase, IprDocRel, IprEvent,
|
||||
from ietf.ipr.models import (IprDisclosureBase, IprDocRel, IprEvent,
|
||||
RelatedIpr, HolderIprDisclosure, ThirdPartyIprDisclosure, GenericIprDisclosure,
|
||||
NonDocSpecificIprDisclosure)
|
||||
|
||||
|
@ -85,10 +85,6 @@ class NonDocSpecificIprDisclosureAdmin(admin.ModelAdmin):
|
|||
|
||||
admin.site.register(NonDocSpecificIprDisclosure, NonDocSpecificIprDisclosureAdmin)
|
||||
|
||||
class IprNotificationAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
admin.site.register(IprNotification, IprNotificationAdmin)
|
||||
|
||||
class IprDocRelAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ["disclosure", "document"]
|
||||
admin.site.register(IprDocRel, IprDocRelAdmin)
|
||||
|
|
53
ietf/ipr/migrations/0002_remove_legacy_models.py
Normal file
53
ietf/ipr/migrations/0002_remove_legacy_models.py
Normal file
|
@ -0,0 +1,53 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipr', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='iprcontact',
|
||||
name='ipr',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='IprContact',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='iprdocalias',
|
||||
name='doc_alias',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='iprdocalias',
|
||||
name='ipr',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='IprDocAlias',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='iprnotification',
|
||||
name='ipr',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='IprNotification',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='iprupdate',
|
||||
name='ipr',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='iprupdate',
|
||||
name='updated',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='IprDetail',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='IprUpdate',
|
||||
),
|
||||
]
|
|
@ -1,181 +1,12 @@
|
|||
# Copyright The IETF Trust 2007, All Rights Reserved
|
||||
|
||||
from django.db import models
|
||||
|
||||
from ietf.doc.models import DocAlias
|
||||
|
||||
|
||||
LICENSE_CHOICES = (
|
||||
(0, ''),
|
||||
(1, 'a) No License Required for Implementers.'),
|
||||
(2, 'b) Royalty-Free, Reasonable and Non-Discriminatory License to All Implementers.'),
|
||||
(3, 'c) Reasonable and Non-Discriminatory License to All Implementers with Possible Royalty/Fee.'),
|
||||
(4, 'd) Licensing Declaration to be Provided Later (implies a willingness'
|
||||
' to commit to the provisions of a), b), or c) above to all implementers;'
|
||||
' otherwise, the next option "Unwilling to Commit to the Provisions of'
|
||||
' a), b), or c) Above". - must be selected).'),
|
||||
(5, 'e) Unwilling to Commit to the Provisions of a), b), or c) Above.'),
|
||||
(6, 'f) See Text Below for Licensing Declaration.'),
|
||||
)
|
||||
STDONLY_CHOICES = (
|
||||
(0, ""),
|
||||
(1, "The licensing declaration is limited solely to standards-track IETF documents."),
|
||||
)
|
||||
SELECT_CHOICES = (
|
||||
(0, 'NO'),
|
||||
(1, 'YES'),
|
||||
(2, 'NO'),
|
||||
)
|
||||
STATUS_CHOICES = (
|
||||
( 0, "Waiting for approval" ),
|
||||
( 1, "Approved and Posted" ),
|
||||
( 2, "Rejected by Administrator" ),
|
||||
( 3, "Removed by Request" ),
|
||||
)
|
||||
|
||||
class IprDetail(models.Model):
|
||||
ipr_id = models.AutoField(primary_key=True)
|
||||
title = models.CharField(blank=True, db_column="document_title", max_length=255)
|
||||
|
||||
# Legacy information fieldset
|
||||
legacy_url_0 = models.CharField(blank=True, null=True, db_column="old_ipr_url", max_length=255)
|
||||
legacy_url_1 = models.CharField(blank=True, null=True, db_column="additional_old_url1", max_length=255)
|
||||
legacy_title_1 = models.CharField(blank=True, null=True, db_column="additional_old_title1", max_length=255)
|
||||
legacy_url_2 = models.CharField(blank=True, null=True, db_column="additional_old_url2", max_length=255)
|
||||
legacy_title_2 = models.CharField(blank=True, null=True, db_column="additional_old_title2", max_length=255)
|
||||
|
||||
# Patent holder fieldset
|
||||
legal_name = models.CharField("Legal Name", db_column="p_h_legal_name", max_length=255)
|
||||
|
||||
# Patent Holder Contact fieldset
|
||||
# self.contact.filter(contact_type=1)
|
||||
|
||||
# IETF Contact fieldset
|
||||
# self.contact.filter(contact_type=3)
|
||||
|
||||
# Related IETF Documents fieldset
|
||||
rfc_number = models.IntegerField(null=True, editable=False, blank=True) # always NULL
|
||||
id_document_tag = models.IntegerField(null=True, editable=False, blank=True) # always NULL
|
||||
other_designations = models.CharField(blank=True, max_length=255)
|
||||
document_sections = models.TextField("Specific document sections covered", blank=True, max_length=255, db_column='disclouser_identify')
|
||||
|
||||
# Patent Information fieldset
|
||||
patents = models.TextField("Patent Applications", db_column="p_applications", max_length=255)
|
||||
date_applied = models.CharField(max_length=255)
|
||||
country = models.CharField(max_length=255)
|
||||
notes = models.TextField("Additional notes", db_column="p_notes", blank=True)
|
||||
is_pending = models.IntegerField("Unpublished Pending Patent Application", blank=True, null=True, choices=SELECT_CHOICES, db_column="selecttype")
|
||||
applies_to_all = models.IntegerField("Applies to all IPR owned by Submitter", blank=True, null=True, choices=SELECT_CHOICES, db_column="selectowned")
|
||||
|
||||
# Licensing Declaration fieldset
|
||||
licensing_option = models.IntegerField(null=True, blank=True, choices=LICENSE_CHOICES)
|
||||
lic_opt_a_sub = models.IntegerField(null=True, editable=False, choices=STDONLY_CHOICES)
|
||||
lic_opt_b_sub = models.IntegerField(null=True, editable=False, choices=STDONLY_CHOICES)
|
||||
lic_opt_c_sub = models.IntegerField(null=True, editable=False, choices=STDONLY_CHOICES)
|
||||
comments = models.TextField("Licensing Comments", blank=True)
|
||||
lic_checkbox = models.BooleanField("All terms and conditions has been disclosed", default=False)
|
||||
|
||||
|
||||
# Other notes fieldset
|
||||
other_notes = models.TextField(blank=True)
|
||||
|
||||
# Generated fields, not part of the submission form
|
||||
# Hidden fields
|
||||
third_party = models.BooleanField(default=False)
|
||||
generic = models.BooleanField(default=False)
|
||||
comply = models.BooleanField(default=False)
|
||||
|
||||
status = models.IntegerField(null=True, blank=True, choices=STATUS_CHOICES)
|
||||
submitted_date = models.DateField(blank=True)
|
||||
update_notified_date = models.DateField(null=True, blank=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('ietf.ipr.views.show', [str(self.ipr_id)])
|
||||
|
||||
def get_submitter(self):
|
||||
try:
|
||||
return self.contact.get(contact_type=3)
|
||||
except IprContact.DoesNotExist:
|
||||
return None
|
||||
except IprContact.MultipleObjectsReturned:
|
||||
return self.contact.filter(contact_type=3)[0]
|
||||
|
||||
def docs(self):
|
||||
return self.iprdocalias_set.select_related("doc_alias", "doc_alias__document").order_by("id")
|
||||
|
||||
class IprContact(models.Model):
|
||||
TYPE_CHOICES = (
|
||||
(1, 'Patent Holder Contact'),
|
||||
(2, 'IETF Participant Contact'),
|
||||
(3, 'Submitter Contact'),
|
||||
)
|
||||
contact_id = models.AutoField(primary_key=True)
|
||||
ipr = models.ForeignKey(IprDetail, related_name="contact")
|
||||
contact_type = models.IntegerField(choices=TYPE_CHOICES)
|
||||
name = models.CharField(max_length=255)
|
||||
title = models.CharField(blank=True, max_length=255)
|
||||
department = models.CharField(blank=True, max_length=255)
|
||||
address1 = models.CharField(blank=True, max_length=255)
|
||||
address2 = models.CharField(blank=True, max_length=255)
|
||||
telephone = models.CharField(blank=True, max_length=25)
|
||||
fax = models.CharField(blank=True, max_length=25)
|
||||
email = models.EmailField(max_length=255)
|
||||
def __str__(self):
|
||||
return self.name or '<no name>'
|
||||
|
||||
|
||||
class IprNotification(models.Model):
|
||||
ipr = models.ForeignKey(IprDetail)
|
||||
notification = models.TextField(blank=True)
|
||||
date_sent = models.DateField(null=True, blank=True)
|
||||
time_sent = models.CharField(blank=True, max_length=25)
|
||||
def __str__(self):
|
||||
return "IPR notification for %s sent %s %s" % (self.ipr, self.date_sent, self.time_sent)
|
||||
|
||||
class IprUpdate(models.Model):
|
||||
ipr = models.ForeignKey(IprDetail, related_name='updates')
|
||||
updated = models.ForeignKey(IprDetail, db_column='updated', related_name='updated_by')
|
||||
status_to_be = models.IntegerField(null=True, blank=True)
|
||||
processed = models.IntegerField(null=True, blank=True)
|
||||
|
||||
|
||||
class IprDocAlias(models.Model):
|
||||
ipr = models.ForeignKey(IprDetail)
|
||||
doc_alias = models.ForeignKey(DocAlias)
|
||||
rev = models.CharField(max_length=2, blank=True)
|
||||
|
||||
def formatted_name(self):
|
||||
name = self.doc_alias.name
|
||||
if name.startswith("rfc"):
|
||||
return name.upper()
|
||||
elif self.rev:
|
||||
return "%s-%s" % (name, self.rev)
|
||||
else:
|
||||
return name
|
||||
|
||||
def __unicode__(self):
|
||||
if self.rev:
|
||||
return u"%s which applies to %s-%s" % (self.ipr, self.doc_alias.name, self.rev)
|
||||
else:
|
||||
return u"%s which applies to %s" % (self.ipr, self.doc_alias.name)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "IPR document alias"
|
||||
verbose_name_plural = "IPR document aliases"
|
||||
|
||||
# ===================================
|
||||
# New Models
|
||||
# ===================================
|
||||
|
||||
import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db import models
|
||||
|
||||
from ietf.doc.models import DocAlias
|
||||
from ietf.name.models import DocRelationshipName,IprDisclosureStateName,IprLicenseTypeName,IprEventTypeName
|
||||
from ietf.person.models import Person
|
||||
from ietf.message.models import Message
|
||||
|
|
|
@ -1,113 +1,269 @@
|
|||
# Autogenerated by the mkresources management command 2014-11-13 23:53
|
||||
# Autogenerated by the mkresources management command 2015-03-21 14:05 PDT
|
||||
from tastypie.resources import ModelResource
|
||||
from tastypie.fields import ToOneField
|
||||
from tastypie.constants import ALL, ALL_WITH_RELATIONS
|
||||
from tastypie.fields import ToOneField, ToManyField # pyflakes:ignore
|
||||
from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore
|
||||
|
||||
from ietf import api
|
||||
|
||||
from ietf.ipr.models import * # pyflakes:ignore
|
||||
from ietf.ipr.models import * # pyflakes:ignore
|
||||
|
||||
|
||||
class IprDetailResource(ModelResource):
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.name.resources import IprDisclosureStateNameResource
|
||||
from ietf.doc.resources import DocAliasResource
|
||||
class IprDisclosureBaseResource(ModelResource):
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
state = ToOneField(IprDisclosureStateNameResource, 'state')
|
||||
docs = ToManyField(DocAliasResource, 'docs', null=True)
|
||||
rel = ToManyField('ietf.ipr.resources.IprDisclosureBaseResource', 'rel', null=True)
|
||||
class Meta:
|
||||
queryset = IprDetail.objects.all()
|
||||
#resource_name = 'iprdetail'
|
||||
queryset = IprDisclosureBase.objects.all()
|
||||
#resource_name = 'iprdisclosurebase'
|
||||
filtering = {
|
||||
"ipr_id": ALL,
|
||||
"title": ALL,
|
||||
"legacy_url_0": ALL,
|
||||
"legacy_url_1": ALL,
|
||||
"legacy_title_1": ALL,
|
||||
"legacy_url_2": ALL,
|
||||
"legacy_title_2": ALL,
|
||||
"legal_name": ALL,
|
||||
"rfc_number": ALL,
|
||||
"id_document_tag": ALL,
|
||||
"other_designations": ALL,
|
||||
"document_sections": ALL,
|
||||
"patents": ALL,
|
||||
"date_applied": ALL,
|
||||
"country": ALL,
|
||||
"id": ALL,
|
||||
"compliant": ALL,
|
||||
"holder_legal_name": ALL,
|
||||
"notes": ALL,
|
||||
"is_pending": ALL,
|
||||
"applies_to_all": ALL,
|
||||
"licensing_option": ALL,
|
||||
"lic_opt_a_sub": ALL,
|
||||
"lic_opt_b_sub": ALL,
|
||||
"lic_opt_c_sub": ALL,
|
||||
"comments": ALL,
|
||||
"lic_checkbox": ALL,
|
||||
"other_notes": ALL,
|
||||
"third_party": ALL,
|
||||
"generic": ALL,
|
||||
"comply": ALL,
|
||||
"status": ALL,
|
||||
"submitted_date": ALL,
|
||||
"update_notified_date": ALL,
|
||||
"other_designations": ALL,
|
||||
"submitter_name": ALL,
|
||||
"submitter_email": ALL,
|
||||
"time": ALL,
|
||||
"title": ALL,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"state": ALL_WITH_RELATIONS,
|
||||
"docs": ALL_WITH_RELATIONS,
|
||||
"rel": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(IprDetailResource())
|
||||
api.ipr.register(IprDisclosureBaseResource())
|
||||
|
||||
from ietf.doc.resources import DocAliasResource
|
||||
class IprDocAliasResource(ModelResource):
|
||||
ipr = ToOneField(IprDetailResource, 'ipr')
|
||||
doc_alias = ToOneField(DocAliasResource, 'doc_alias')
|
||||
class IprDocRelResource(ModelResource):
|
||||
disclosure = ToOneField(IprDisclosureBaseResource, 'disclosure')
|
||||
document = ToOneField(DocAliasResource, 'document')
|
||||
class Meta:
|
||||
queryset = IprDocAlias.objects.all()
|
||||
#resource_name = 'iprdocalias'
|
||||
queryset = IprDocRel.objects.all()
|
||||
#resource_name = 'iprdocrel'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"rev": ALL,
|
||||
"ipr": ALL_WITH_RELATIONS,
|
||||
"doc_alias": ALL_WITH_RELATIONS,
|
||||
"sections": ALL,
|
||||
"revisions": ALL,
|
||||
"disclosure": ALL_WITH_RELATIONS,
|
||||
"document": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(IprDocAliasResource())
|
||||
api.ipr.register(IprDocRelResource())
|
||||
|
||||
class IprNotificationResource(ModelResource):
|
||||
ipr = ToOneField(IprDetailResource, 'ipr')
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.name.resources import IprDisclosureStateNameResource, IprLicenseTypeNameResource
|
||||
from ietf.doc.resources import DocAliasResource
|
||||
class HolderIprDisclosureResource(ModelResource):
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
state = ToOneField(IprDisclosureStateNameResource, 'state')
|
||||
iprdisclosurebase_ptr = ToOneField(IprDisclosureBaseResource, 'iprdisclosurebase_ptr')
|
||||
licensing = ToOneField(IprLicenseTypeNameResource, 'licensing')
|
||||
docs = ToManyField(DocAliasResource, 'docs', null=True)
|
||||
rel = ToManyField(IprDisclosureBaseResource, 'rel', null=True)
|
||||
class Meta:
|
||||
queryset = IprNotification.objects.all()
|
||||
#resource_name = 'iprnotification'
|
||||
queryset = HolderIprDisclosure.objects.all()
|
||||
#resource_name = 'holderiprdisclosure'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"notification": ALL,
|
||||
"date_sent": ALL,
|
||||
"time_sent": ALL,
|
||||
"ipr": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(IprNotificationResource())
|
||||
|
||||
class IprContactResource(ModelResource):
|
||||
ipr = ToOneField(IprDetailResource, 'ipr')
|
||||
class Meta:
|
||||
queryset = IprContact.objects.all()
|
||||
#resource_name = 'iprcontact'
|
||||
filtering = {
|
||||
"contact_id": ALL,
|
||||
"contact_type": ALL,
|
||||
"name": ALL,
|
||||
"compliant": ALL,
|
||||
"holder_legal_name": ALL,
|
||||
"notes": ALL,
|
||||
"other_designations": ALL,
|
||||
"submitter_name": ALL,
|
||||
"submitter_email": ALL,
|
||||
"time": ALL,
|
||||
"title": ALL,
|
||||
"department": ALL,
|
||||
"address1": ALL,
|
||||
"address2": ALL,
|
||||
"telephone": ALL,
|
||||
"fax": ALL,
|
||||
"email": ALL,
|
||||
"ipr": ALL_WITH_RELATIONS,
|
||||
"ietfer_name": ALL,
|
||||
"ietfer_contact_email": ALL,
|
||||
"ietfer_contact_info": ALL,
|
||||
"patent_info": ALL,
|
||||
"has_patent_pending": ALL,
|
||||
"holder_contact_email": ALL,
|
||||
"holder_contact_name": ALL,
|
||||
"holder_contact_info": ALL,
|
||||
"licensing_comments": ALL,
|
||||
"submitter_claims_all_terms_disclosed": ALL,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"state": ALL_WITH_RELATIONS,
|
||||
"iprdisclosurebase_ptr": ALL_WITH_RELATIONS,
|
||||
"licensing": ALL_WITH_RELATIONS,
|
||||
"docs": ALL_WITH_RELATIONS,
|
||||
"rel": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(IprContactResource())
|
||||
api.ipr.register(HolderIprDisclosureResource())
|
||||
|
||||
class IprUpdateResource(ModelResource):
|
||||
ipr = ToOneField(IprDetailResource, 'ipr')
|
||||
updated = ToOneField(IprDetailResource, 'updated')
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.name.resources import IprDisclosureStateNameResource
|
||||
from ietf.doc.resources import DocAliasResource
|
||||
class ThirdPartyIprDisclosureResource(ModelResource):
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
state = ToOneField(IprDisclosureStateNameResource, 'state')
|
||||
iprdisclosurebase_ptr = ToOneField(IprDisclosureBaseResource, 'iprdisclosurebase_ptr')
|
||||
docs = ToManyField(DocAliasResource, 'docs', null=True)
|
||||
rel = ToManyField(IprDisclosureBaseResource, 'rel', null=True)
|
||||
class Meta:
|
||||
queryset = IprUpdate.objects.all()
|
||||
#resource_name = 'iprupdate'
|
||||
queryset = ThirdPartyIprDisclosure.objects.all()
|
||||
#resource_name = 'thirdpartyiprdisclosure'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"status_to_be": ALL,
|
||||
"processed": ALL,
|
||||
"ipr": ALL_WITH_RELATIONS,
|
||||
"updated": ALL_WITH_RELATIONS,
|
||||
"compliant": ALL,
|
||||
"holder_legal_name": ALL,
|
||||
"notes": ALL,
|
||||
"other_designations": ALL,
|
||||
"submitter_name": ALL,
|
||||
"submitter_email": ALL,
|
||||
"time": ALL,
|
||||
"title": ALL,
|
||||
"ietfer_name": ALL,
|
||||
"ietfer_contact_email": ALL,
|
||||
"ietfer_contact_info": ALL,
|
||||
"patent_info": ALL,
|
||||
"has_patent_pending": ALL,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"state": ALL_WITH_RELATIONS,
|
||||
"iprdisclosurebase_ptr": ALL_WITH_RELATIONS,
|
||||
"docs": ALL_WITH_RELATIONS,
|
||||
"rel": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(IprUpdateResource())
|
||||
api.ipr.register(ThirdPartyIprDisclosureResource())
|
||||
|
||||
from ietf.name.resources import DocRelationshipNameResource
|
||||
class RelatedIprResource(ModelResource):
|
||||
source = ToOneField(IprDisclosureBaseResource, 'source')
|
||||
target = ToOneField(IprDisclosureBaseResource, 'target')
|
||||
relationship = ToOneField(DocRelationshipNameResource, 'relationship')
|
||||
class Meta:
|
||||
queryset = RelatedIpr.objects.all()
|
||||
#resource_name = 'relatedipr'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"source": ALL_WITH_RELATIONS,
|
||||
"target": ALL_WITH_RELATIONS,
|
||||
"relationship": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(RelatedIprResource())
|
||||
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.name.resources import IprDisclosureStateNameResource
|
||||
from ietf.doc.resources import DocAliasResource
|
||||
class NonDocSpecificIprDisclosureResource(ModelResource):
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
state = ToOneField(IprDisclosureStateNameResource, 'state')
|
||||
iprdisclosurebase_ptr = ToOneField(IprDisclosureBaseResource, 'iprdisclosurebase_ptr')
|
||||
docs = ToManyField(DocAliasResource, 'docs', null=True)
|
||||
rel = ToManyField(IprDisclosureBaseResource, 'rel', null=True)
|
||||
class Meta:
|
||||
queryset = NonDocSpecificIprDisclosure.objects.all()
|
||||
#resource_name = 'nondocspecificiprdisclosure'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"compliant": ALL,
|
||||
"holder_legal_name": ALL,
|
||||
"notes": ALL,
|
||||
"other_designations": ALL,
|
||||
"submitter_name": ALL,
|
||||
"submitter_email": ALL,
|
||||
"time": ALL,
|
||||
"title": ALL,
|
||||
"holder_contact_name": ALL,
|
||||
"holder_contact_email": ALL,
|
||||
"holder_contact_info": ALL,
|
||||
"patent_info": ALL,
|
||||
"has_patent_pending": ALL,
|
||||
"statement": ALL,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"state": ALL_WITH_RELATIONS,
|
||||
"iprdisclosurebase_ptr": ALL_WITH_RELATIONS,
|
||||
"docs": ALL_WITH_RELATIONS,
|
||||
"rel": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(NonDocSpecificIprDisclosureResource())
|
||||
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.name.resources import IprDisclosureStateNameResource
|
||||
from ietf.doc.resources import DocAliasResource
|
||||
class GenericIprDisclosureResource(ModelResource):
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
state = ToOneField(IprDisclosureStateNameResource, 'state')
|
||||
iprdisclosurebase_ptr = ToOneField(IprDisclosureBaseResource, 'iprdisclosurebase_ptr')
|
||||
docs = ToManyField(DocAliasResource, 'docs', null=True)
|
||||
rel = ToManyField(IprDisclosureBaseResource, 'rel', null=True)
|
||||
class Meta:
|
||||
queryset = GenericIprDisclosure.objects.all()
|
||||
#resource_name = 'genericiprdisclosure'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"compliant": ALL,
|
||||
"holder_legal_name": ALL,
|
||||
"notes": ALL,
|
||||
"other_designations": ALL,
|
||||
"submitter_name": ALL,
|
||||
"submitter_email": ALL,
|
||||
"time": ALL,
|
||||
"title": ALL,
|
||||
"holder_contact_name": ALL,
|
||||
"holder_contact_email": ALL,
|
||||
"holder_contact_info": ALL,
|
||||
"statement": ALL,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"state": ALL_WITH_RELATIONS,
|
||||
"iprdisclosurebase_ptr": ALL_WITH_RELATIONS,
|
||||
"docs": ALL_WITH_RELATIONS,
|
||||
"rel": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(GenericIprDisclosureResource())
|
||||
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.message.resources import MessageResource
|
||||
from ietf.name.resources import IprEventTypeNameResource
|
||||
class IprEventResource(ModelResource):
|
||||
type = ToOneField(IprEventTypeNameResource, 'type')
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
disclosure = ToOneField(IprDisclosureBaseResource, 'disclosure')
|
||||
message = ToOneField(MessageResource, 'message', null=True)
|
||||
in_reply_to = ToOneField(MessageResource, 'in_reply_to', null=True)
|
||||
class Meta:
|
||||
queryset = IprEvent.objects.all()
|
||||
#resource_name = 'iprevent'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"time": ALL,
|
||||
"desc": ALL,
|
||||
"response_due": ALL,
|
||||
"type": ALL_WITH_RELATIONS,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"disclosure": ALL_WITH_RELATIONS,
|
||||
"message": ALL_WITH_RELATIONS,
|
||||
"in_reply_to": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(IprEventResource())
|
||||
|
||||
from ietf.person.resources import PersonResource
|
||||
from ietf.message.resources import MessageResource
|
||||
from ietf.name.resources import IprEventTypeNameResource
|
||||
class LegacyMigrationIprEventResource(ModelResource):
|
||||
type = ToOneField(IprEventTypeNameResource, 'type')
|
||||
by = ToOneField(PersonResource, 'by')
|
||||
disclosure = ToOneField(IprDisclosureBaseResource, 'disclosure')
|
||||
message = ToOneField(MessageResource, 'message', null=True)
|
||||
in_reply_to = ToOneField(MessageResource, 'in_reply_to', null=True)
|
||||
iprevent_ptr = ToOneField(IprEventResource, 'iprevent_ptr')
|
||||
class Meta:
|
||||
queryset = LegacyMigrationIprEvent.objects.all()
|
||||
#resource_name = 'legacymigrationiprevent'
|
||||
filtering = {
|
||||
"id": ALL,
|
||||
"time": ALL,
|
||||
"desc": ALL,
|
||||
"response_due": ALL,
|
||||
"type": ALL_WITH_RELATIONS,
|
||||
"by": ALL_WITH_RELATIONS,
|
||||
"disclosure": ALL_WITH_RELATIONS,
|
||||
"message": ALL_WITH_RELATIONS,
|
||||
"in_reply_to": ALL_WITH_RELATIONS,
|
||||
"iprevent_ptr": ALL_WITH_RELATIONS,
|
||||
}
|
||||
api.ipr.register(LegacyMigrationIprEventResource())
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
{% include "doc/search/status_columns.html" %}
|
||||
|
||||
<td class="ipr">
|
||||
{% if doc.iprs %}
|
||||
<a href="{% url "ipr_search" %}?submit=draft&id={{ doc.name }}">{{ doc.iprs|length }}</a>
|
||||
{% if doc.related_ipr %}
|
||||
<a href="{% url "ipr_search" %}?submit=draft&id={{ doc.name }}">{{ doc.related_ipr|length }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
|
|
Loading…
Reference in a new issue