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)
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')
def item_link(self, item): return reverse_resource(item, 'collection-concept-detail')
def link(self, obj): return reverse_resource(obj, 'collection-detail')
def url(self): return self.uri or reverse_resource(self, self.view_name)
def versions_url(self): return reverse_resource(self, 'sourceversion-list')
def versions_url(self): return reverse_resource(self, 'collectionversion-list')
def concepts_url(self): return reverse_resource(self, 'collection-concept-list')