Sort the list of document's cabinets.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
to Jesaja Everling (@jeverling) for the report.
|
||||
- Sort the list of root cabinets. Thanks to Thomas Plotkowiak
|
||||
for the request.
|
||||
|
||||
- Sort the list of a document's cabinets.
|
||||
|
||||
2.7.1 (2017-09-03)
|
||||
==================
|
||||
|
||||
@@ -48,9 +48,11 @@ class CabinetsApp(MayanAppConfig):
|
||||
|
||||
APIEndPoint(app=self, version_string='1')
|
||||
|
||||
# Add explicit order_by as DocumentCabinet ordering Meta option has no
|
||||
# effect.
|
||||
Document.add_to_class(
|
||||
'document_cabinets',
|
||||
lambda document: DocumentCabinet.objects.filter(documents=document)
|
||||
lambda document: DocumentCabinet.objects.filter(documents=document).order_by('parent__label', 'label')
|
||||
)
|
||||
|
||||
ModelPermission.register(
|
||||
|
||||
Reference in New Issue
Block a user