本文整理汇总了Python中mediacore.model.Media.status方法的典型用法代码示例。如果您正苦于以下问题:Python Media.status方法的具体用法?Python Media.status怎么用?Python Media.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mediacore.model.Media
的用法示例。
在下文中一共展示了Media.status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _save_media_obj
# 需要导入模块: from mediacore.model import Media [as 别名]
# 或者: from mediacore.model.Media import status [as 别名]
def _save_media_obj(self, name, email, title, description, tags, file):
# cope with anonymous posters
if name is None:
name = 'Anonymous'
# create our media object as a status-less placeholder initially
media_obj = Media()
media_obj.author = Author(name, email)
media_obj.title = title
media_obj.slug = get_available_slug(Media, title)
media_obj.description = helpers.clean_xhtml(description)
media_obj.status = 'draft,unencoded,unreviewed'
media_obj.notes = helpers.fetch_setting('wording_additional_notes')
media_obj.set_tags(tags)
# Create a media object, add it to the media_obj, and store the file permanently.
media_file = _add_new_media_file(media_obj, file.filename, file.file)
# Add the final changes.
media_obj.update_type()
media_obj.update_status()
DBSession.add(media_obj)
return media_obj