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


Python IStore.remove方法代码示例

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


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

示例1: destroySelf

# 需要导入模块: from lp.services.database.interfaces import IStore [as 别名]
# 或者: from lp.services.database.interfaces.IStore import remove [as 别名]
 def destroySelf(self):
     store = IStore(Packageset)
     sources = store.find(
         PackagesetSources,
         PackagesetSources.packageset == self)
     sources.remove()
     store.remove(self)
     if self.relatedSets().is_empty():
         store.remove(self.packagesetgroup)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:11,代码来源:packageset.py

示例2: removeDeviceClass

# 需要导入模块: from lp.services.database.interfaces import IStore [as 别名]
# 或者: from lp.services.database.interfaces.IStore import remove [as 别名]
 def removeDeviceClass(self, main_class, sub_class=None):
     """See `IHWDevice.`"""
     store = IStore(HWDeviceClass)
     result_set = store.find(
         HWDeviceClass,
         HWDeviceClass.device == self.id,
         HWDeviceClass.main_class == main_class,
         HWDeviceClass.sub_class == sub_class,
     )
     existing_record = result_set.one()
     if existing_record is not None:
         store.remove(existing_record)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:14,代码来源:hwdb.py

示例3: _set_tags

# 需要导入模块: from lp.services.database.interfaces import IStore [as 别名]
# 或者: from lp.services.database.interfaces.IStore import remove [as 别名]
    def _set_tags(self, tags):
        """Update the tags to filter on.

        The tags can be qualified with a leading hyphen, and can be bundled in
        any iterable.

        If they are passed within a `searchbuilder.any` or `searchbuilder.all`
        object, the `find_all_tags` attribute will be updated to match.

        Wildcard tags - `*` and `-*` - can be given too, and will update
        `include_any_tags` and `exclude_any_tags`.
        """
        # Deal with searchbuilder terms.
        if isinstance(tags, searchbuilder.all):
            self.find_all_tags = True
            tags = frozenset(tags.query_values)
        elif isinstance(tags, searchbuilder.any):
            self.find_all_tags = False
            tags = frozenset(tags.query_values)
        else:
            # Leave find_all_tags unchanged.
            tags = frozenset(tags)
        wildcards = frozenset((u"*", u"-*")).intersection(tags)
        # Set wildcards.
        self.include_any_tags = "*" in wildcards
        self.exclude_any_tags = "-*" in wildcards
        # Deal with other tags.
        tags = tags - wildcards
        store = IStore(BugSubscriptionFilterTag)
        current_tag_filters = dict(
            (tag_filter.qualified_tag, tag_filter)
            for tag_filter in store.find(
                BugSubscriptionFilterTag,
                BugSubscriptionFilterTag.filter == self))
        # Remove unused tags.
        for tag in set(current_tag_filters).difference(tags):
            tag_filter = current_tag_filters.pop(tag)
            store.remove(tag_filter)
        # Add additional tags.
        for tag in tags.difference(current_tag_filters):
            tag_filter = BugSubscriptionFilterTag()
            tag_filter.filter = self
            tag_filter.include = not tag.startswith("-")
            tag_filter.tag = tag.lstrip("-")
            store.add(tag_filter)
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:47,代码来源:bugsubscriptionfilter.py


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