Bugfixes in new sorting/filtering features.

This commit is contained in:
Gaetan Delannay 2010-04-30 14:43:44 +02:00
parent f5a92b7cb0
commit cb216a9e9c
4 changed files with 20 additions and 5 deletions

View file

@ -668,6 +668,13 @@ class AbstractMixin:
reverse = rq.get('reverse') == 'True'
self.appy().sort(fieldName, sortKey=sortKey, reverse=reverse)
def isRefSortable(self, fieldName):
'''Can p_fieldName, which is a field defined on self, be used as a sort
key in a reference field?'''
appyType = self.getAppyType(fieldName, asDict=False)
if not appyType: return True # Probably implicit field 'title'.
return appyType.isSortable(usage='ref')
def getWorkflow(self, appy=True):
'''Returns the Appy workflow instance that is relevant for this
object. If p_appy is False, it returns the DC workflow.'''