当前位置: 首页>>代码示例>>Python>>正文


Python Attachment.find方法代码示例

本文整理汇总了Python中indico.modules.attachments.models.attachments.Attachment.find方法的典型用法代码示例。如果您正苦于以下问题:Python Attachment.find方法的具体用法?Python Attachment.find怎么用?Python Attachment.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在indico.modules.attachments.models.attachments.Attachment的用法示例。


在下文中一共展示了Attachment.find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _merge_users

# 需要导入模块: from indico.modules.attachments.models.attachments import Attachment [as 别名]
# 或者: from indico.modules.attachments.models.attachments.Attachment import find [as 别名]
def _merge_users(target, source, **kwargs):
    from indico.modules.attachments.models.attachments import Attachment, AttachmentFile
    from indico.modules.attachments.models.principals import AttachmentPrincipal, AttachmentFolderPrincipal
    Attachment.find(user_id=source.id).update({Attachment.user_id: target.id})
    AttachmentFile.find(user_id=source.id).update({AttachmentFile.user_id: target.id})
    AttachmentPrincipal.merge_users(target, source, 'attachment')
    AttachmentFolderPrincipal.merge_users(target, source, 'folder')
开发者ID:DirkHoffmann,项目名称:indico,代码行数:9,代码来源:__init__.py

示例2: _build_base_query

# 需要导入模块: from indico.modules.attachments.models.attachments import Attachment [as 别名]
# 或者: from indico.modules.attachments.models.attachments.Attachment import find [as 别名]
 def _build_base_query(self, added_since=None):
     query = Attachment.find(Attachment.type == AttachmentType.file, ~AttachmentFolder.is_deleted,
                             ~Attachment.is_deleted, AttachmentFolder.event_new == self.event_new,
                             _join=AttachmentFolder)
     if added_since is not None:
         query = query.join(Attachment.file).filter(cast(AttachmentFile.created_dt, Date) >= added_since)
     return query
开发者ID:belokop,项目名称:indico_bare,代码行数:9,代码来源:event_package.py

示例3: materialToXMLMarc21

# 需要导入模块: from indico.modules.attachments.models.attachments import Attachment [as 别名]
# 或者: from indico.modules.attachments.models.attachments.Attachment import find [as 别名]
 def materialToXMLMarc21(self, obj, out=None):
     if not out:
         out = self._XMLGen
     for attachment in (Attachment.find(~AttachmentFolder.is_deleted, AttachmentFolder.object == obj,
                                        is_deleted=False, _join=AttachmentFolder)
                                  .options(joinedload(Attachment.legacy_mapping))):
         if attachment.can_access(self.__aw.getUser().user):
             self.resourceToXMLMarc21(attachment, out)
             self._generateAccessList(acl=self._attachment_access_list(attachment), out=out,
                                      objId=self._attachment_unique_id(attachment, add_prefix=False))
开发者ID:OmeGak,项目名称:indico,代码行数:12,代码来源:output.py

示例4: find_attachments

# 需要导入模块: from indico.modules.attachments.models.attachments import Attachment [as 别名]
# 或者: from indico.modules.attachments.models.attachments.Attachment import find [as 别名]
 def find_attachments(self):
     return Attachment.find(~AttachmentFolder.is_deleted, ~Attachment.is_deleted,
                            AttachmentFolder.event_id == int(self.event.id), _join=AttachmentFolder)
开发者ID:hennogous,项目名称:indico,代码行数:5,代码来源:clone.py

示例5: _count_attachments

# 需要导入模块: from indico.modules.attachments.models.attachments import Attachment [as 别名]
# 或者: from indico.modules.attachments.models.attachments.Attachment import find [as 别名]
 def _count_attachments(cls, obj):
     return Attachment.find(~AttachmentFolder.is_deleted, AttachmentFolder.linked_object == obj,
                            is_deleted=False, _join=AttachmentFolder).count()
开发者ID:MichelCordeiro,项目名称:indico,代码行数:5,代码来源:statistics.py


注:本文中的indico.modules.attachments.models.attachments.Attachment.find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。