Add 'siblings' convenience method to the DocumentPage model

This commit is contained in:
Roberto Rosario
2011-12-03 20:43:30 -04:00
parent 0cf8d68db0
commit 4bbf5d3514

View File

@@ -543,6 +543,10 @@ class DocumentPage(models.Model):
@models.permalink
def get_absolute_url(self):
return ('document_page_view', [self.pk])
@property
def siblings(self):
return DocumentPage.objects.filter(document_version=self.document_version)
# Compatibility methods
@property