Example #1
0
def stamp_uri(sender, instance, **kwargs):
    if issubclass(sender, BaseModel):
        if hasattr(instance, 'versioned_object'):
            instance.uri = reverse_resource_version(instance,
                                                    instance.view_name)
        else:
            instance.uri = reverse_resource(instance, instance.view_name)
Example #2
0
 def concept_reference_url(self):
     if self.source_version:
         source_version_url = reverse_resource_version(self.source_version,
                                                       'sourceversion-detail')
         return urljoin(source_version_url, 'concepts/%s/' % self.concept.mnemonic)
     if self.concept_version:
         return reverse_resource_version(self.concept_version, 'conceptversion-detail')
     return reverse_resource(self.concept, 'concept-detail')
Example #3
0
 def item_link(self, item):
     return reverse_resource(item, 'collection-concept-detail')
Example #4
0
 def link(self, obj):
     return reverse_resource(obj, 'collection-detail')
Example #5
0
def stamp_uri(sender, instance, **kwargs):
    if issubclass(sender, BaseModel):
        if hasattr(instance, 'versioned_object'):
            instance.uri = reverse_resource_version(instance, instance.view_name)
        else:
            instance.uri = reverse_resource(instance, instance.view_name)
Example #6
0
 def url(self):
     return self.uri or reverse_resource(self, self.view_name)
Example #7
0
 def url(self):
     return self.uri or reverse_resource(self, self.view_name)
Example #8
0
 def versions_url(self):
     return reverse_resource(self, 'sourceversion-list')
Example #9
0
 def versions_url(self):
     return reverse_resource(self, 'collectionversion-list')
Example #10
0
 def versions_url(self):
     return reverse_resource(self, 'collectionversion-list')
Example #11
0
 def concepts_url(self):
     return reverse_resource(self, 'collection-concept-list')
Example #12
0
 def item_link(self, item):
     return reverse_resource(item, 'collection-concept-detail')
Example #13
0
 def link(self, obj):
     return reverse_resource(obj, 'collection-detail')