本文整理汇总了Python中Auth.get_user_name方法的典型用法代码示例。如果您正苦于以下问题:Python Auth.get_user_name方法的具体用法?Python Auth.get_user_name怎么用?Python Auth.get_user_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth
的用法示例。
在下文中一共展示了Auth.get_user_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_owner_email
# 需要导入模块: import Auth [as 别名]
# 或者: from Auth import get_user_name [as 别名]
def _get_owner_email (self, asset):
user_id = asset['publisher_id']
if not user_id:
return
user_name = Auth.get_user_name (user_id)
user = Auth.get_user (user_name)
return user['email']
示例2: get_diz
# 需要导入模块: import Auth [as 别名]
# 或者: from Auth import get_user_name [as 别名]
def get_diz (self, limit=1):
if not self._tags:
self._lookup_tags(limit)
desc, license_name = '',''
if self['tags'].has_key('Description'):
desc = self['tags']['Description'][0]
if self['tags'].has_key('Rights'):
license_name=self['tags']['Rights'][0]
d = { 'thumb': THUMB_COLLECTION,
'creator': Auth.get_user_name (self['creator_id']),
'license': license_name,
'title': self['name'],
'desc': desc,
}
return d
示例3: __init__
# 需要导入模块: import Auth [as 别名]
# 或者: from Auth import get_user_name [as 别名]
def __init__ (self, refreshable, content,**kwargs):
CTK.Container.__init__(self)
self.table = CTK.Table()
# Header
row = ['','Añadir', 'Editar', 'Borrar', 'Consumir', 'Rol', 'Usuario']
self.table[(1,1)] = [CTK.RawHTML(x) for x in row]
self.table.set_header (row=True, num=1)
# Entries
self.n = 2
acl = ACL()
entries = acl.acl_generic(content, summarize=False)
c_id, c_type = get_id_and_type (content)
for entry in entries:
user_id = entry.get('user_id')
role_id = entry.get('role')
id_acl = entry.get('id_acl')
user, role = 'Todos','Todos'
if user_id: user = Auth.get_user_name (user_id)
if role_id: role = Role.role_to_name (role_id)
ad,ed,rm,co = entry['tuple']
delete = CTK.Image ({'src': '/CTK/images/del.png', 'alt': 'Del'})
delete.bind('click', CTK.JS.Ajax ('%s/del/%s/%s/%s' % (LOCATION, c_type, c_id, id_acl),
data = {'id_acl': id_acl},
complete = refreshable.JS_to_refresh()))
row = [delete] + [CTK.RawHTML(str(x)) for x in [ad,ed,rm,co,role,user]]
self.table[(self.n,1)] = row
self.n += 1
self.add_new (content, refreshable)
示例4: _compile_tags
# 需要导入模块: import Auth [as 别名]
# 或者: from Auth import get_user_name [as 别名]
def _compile_tags (self):
# Versions & Source
version_of = None
version = self._db.get('version', None)
versions = [x['id'] for x in self._versions if x['id']!=self['id']]
source = self._parent_id
if self['version'] != 1:
version_of = self._replacements.get('replaces')
# Formats
has_formats = None
is_format_of = None
if self._formats:
format_list =[x['format'] for x in self._formats if x['id']!=self['id']]
has_formats = dict.fromkeys(format_list).keys()
for f in self._formats:
if f['source'] == None and f['id'] != self['id']:
is_format_of = f['id']
self._tags = {
'Creator': self._db.get('creator_id'),
'Date': max(self._db.get('date_modified'), self._db.get('date_edited'), self._db.get('date_created')),
'Date Created': self._db.get('date_created'),
'Date (Modified)': self._db.get('date_modified'),
'Date Available': self._db.get('date_available'),
'Description': self._db.get('description'),
'Extent': self._file.get('extent'),
'Format': self._file.get('formats_id'),
'Has Format': has_formats,
'Has Part': self._parts.get('has_parts_of'),
'Has Version': versions,
'Identifier': self._db.get('id'),
'Is Format Of': is_format_of,
'Is Part Of': self._parts.get('is_part_of'),
'Is Referenced By': self._db.get('collections_id'),
'Is Replaced By': self._replacements.get('replaced_by'),
'Is Version Of': version_of,
'Language': self._db.get('language'),
'Publisher': self._db.get('publisher_id'),
'Relation': self._collection,
'Replaces': self._replacements.get('replaces'),
'Source': source,
'Subject': self._db.get('subject'),
'Title': self._db.get('title'),
'Type': self._db.get('asset_types_id'),
'Rights': self._db.get('licenses_id'),
}
if self['Creator']:
self._tags['Creator'] = Auth.get_user_name (self['tags']['Creator'])
if self['Publisher']:
self._tags['Publisher'] = Auth.get_user_name (self['tags']['Publisher'])
if self['Rights']:
self._tags['Rights'] = License.get_license_name(self['tags']['Rights'])
if self['Format']:
self._tags['Format'] = Format.get_format_name (self['tags']['Format'])
if self['Type']:
self._tags['Type'] = Type.get_type_name (self['tags']['Type'])
for key in self._tags.keys():
if key.startswith('Date') and self._tags[key] == '0000-00-00 00:00:00':
self._tags[key] = None