appy.pod: bugfix when importing images under Windows (https://answers.launchpad.net/appy/+question/171611); appy.gen: bugfix while validating file fields which are mandatory; stopped using uid_catalog and added index 'UID' in portal_catalog; bugfix while searching objects in the limits of a Ref field; display user info in the main template (name, id, roles); when creating an object from a reference, after creation, appy brings the user back to the view page where the Ref field was.

This commit is contained in:
Gaetan Delannay 2011-09-20 19:21:48 +02:00
parent 7ff56a6520
commit 96a592f125
22 changed files with 141 additions and 179 deletions

View file

@ -42,7 +42,7 @@ class ToolWrapper(AbstractWrapper):
rq = self.o.REQUEST
if rq.get('nav', ''):
initiatorUid = rq['nav'].split('.')[1]
res = self.o.uid_catalog(UID=initiatorUid)[0].getObject().appy()
res = self.o.portal_catalog(UID=initiatorUid)[0].getObject().appy()
return res
def getObject(self, uid):

View file

@ -139,7 +139,7 @@ class AbstractWrapper(object):
to a given p_sortKey which must be an attribute set on referred
objects ("title", by default).'''
sortedUids = getattr(self.o, '_appy_%s' % fieldName)
c = self.o.uid_catalog
c = self.o.portal_catalog
sortedUids.sort(lambda x,y: \
cmp(getattr(c(UID=x)[0].getObject().appy(), sortKey),
getattr(c(UID=y)[0].getObject().appy(), sortKey)))