Add 'siblings' convenience method to the DocumentPage model
This commit is contained in:
@@ -543,6 +543,10 @@ class DocumentPage(models.Model):
|
|||||||
@models.permalink
|
@models.permalink
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return ('document_page_view', [self.pk])
|
return ('document_page_view', [self.pk])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def siblings(self):
|
||||||
|
return DocumentPage.objects.filter(document_version=self.document_version)
|
||||||
|
|
||||||
# Compatibility methods
|
# Compatibility methods
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user