本文整理汇总了Python中Type.get_type_name方法的典型用法代码示例。如果您正苦于以下问题:Python Type.get_type_name方法的具体用法?Python Type.get_type_name怎么用?Python Type.get_type_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type.get_type_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _compile_tags
# 需要导入模块: import Type [as 别名]
# 或者: from Type import get_type_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