diff --git a/gen/ui/result.pt b/gen/ui/result.pt
index 6629155..4de78b6 100644
--- a/gen/ui/result.pt
+++ b/gen/ui/result.pt
@@ -124,12 +124,12 @@
+ tal:condition="obj/mayEdit">
|
Delete the element
-
diff --git a/gen/ui/template.pt b/gen/ui/template.pt
index d61044d..0b9f73f 100644
--- a/gen/ui/template.pt
+++ b/gen/ui/template.pt
@@ -143,7 +143,8 @@
|
-
+
|
diff --git a/gen/ui/widgets/ref.pt b/gen/ui/widgets/ref.pt
index 55cb3a6..1e9c741 100644
--- a/gen/ui/widgets/ref.pt
+++ b/gen/ui/widgets/ref.pt
@@ -40,7 +40,7 @@
Edit the element
-
+ |
@@ -48,7 +48,7 @@
|
Delete the element
-
diff --git a/gen/wrappers/__init__.py b/gen/wrappers/__init__.py
index 02a571a..394ed85 100644
--- a/gen/wrappers/__init__.py
+++ b/gen/wrappers/__init__.py
@@ -4,7 +4,7 @@
# ------------------------------------------------------------------------------
import os, os.path, mimetypes
import appy.pod
-from appy.gen import Type, Search, Ref, String
+from appy.gen import Type, Search, Ref, String, WorkflowAnonymous
from appy.gen.utils import createObject
from appy.shared.utils import getOsTempFolder, executeCommand, \
normalizeString, sequenceTypes
@@ -87,6 +87,21 @@ class AbstractWrapper(object):
return customUser.__dict__[methodName](self, *args, **kwargs)
def getField(self, name): return self.o.getAppyType(name)
+ @classmethod
+ def getWorkflow(klass):
+ '''Returns the workflow tied to p_klass.'''
+ # Browse parent classes of p_klass in reverse order. This way, a
+ # user-defined workflow will override a Appy default workflow.
+ i = len(klass.__bases__)-1
+ res = None
+ while i >= 0:
+ res = getattr(klass.__bases__[i], 'workflow', None)
+ if res: break
+ i -= 1
+ # Return a default workflow if no workflow was found.
+ if not res:
+ res = WorkflowAnonymous
+ return res
def link(self, fieldName, obj):
'''This method links p_obj (which can be a list of objects) to this one
|