Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py	(revision 7940)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py	(revision 7941)
@@ -28,4 +28,5 @@
 from zope.component.interfaces import IFactory
 from zope.interface import implementedBy
+from zope.interface.interface import Method, Attribute
 from zope.schema import getFieldNames
 from zope.schema.fieldproperty import FieldProperty
@@ -478,2 +479,32 @@
     account = authenticator.getAccount(principal_id)
     return account
+
+def iface_names(iface, omit=[], exclude_attribs=True, exclude_methods=True):
+    """Get all attribute names of an interface.
+
+    Searches also base interfaces.
+
+    Names of fields that are pure attributes
+    (i.e. zope.interface.Attribute) or methods are excluded by
+    default.
+
+    Names of typical fields derived from zope.schema are included.
+
+    The `omit` paramter can give a list of names to exclude.
+
+    Returns an unsorted list of strings.
+    """
+    ifaces = [iface] + list(iface.getBases())
+    names = []
+    for item in ifaces:
+        names += item.names()
+    names = [x for x in names if x not in omit]
+    result = []
+    for name in names:
+        cls = iface.get(name).__class__
+        if exclude_attribs and cls is Attribute:
+            continue
+        if exclude_methods and cls is Method:
+            continue
+        result.append(name)
+    return result
