from AccessControl import getSecurityManager def _checkPermission(permission, obj): return getSecurityManager().checkPermission(permission, obj) from zope.i18n import translate as ZopeTranslate def translate(ctx, msgid, lang=None, domain="korpus"): """ translate """ return ZopeTranslate(msgid, domain, target_language=lang) import random import string def generateUniq(len, prefix='', suffix=''): """ generate uniq strings """ res = "".join(random.sample(string.ascii_letters, 8)) return prefix+res+suffix