How to use the persistent.list.PersistentList function in persistent

To help you get started, we’ve selected a few persistent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eea / eea.daviz / eea / daviz / app / handler.py View on Github external
def _sources(self):
        anno = IAnnotations(self.context)
        sources = anno.get(ANNO_SOURCES, None)
        if sources is None:
            sources = anno[ANNO_SOURCES] = PersistentList()
        return sources
github eea / eea.facetednavigation / eea / facetednavigation / criteria / handler.py View on Github external
def _criteria(self):
        """ Get criteria from annotations
        """
        anno = IAnnotations(self.context)
        criteria = anno.get(ANNO_CRITERIA, None)
        if criteria is None:
            anno[ANNO_CRITERIA] = PersistentList()
        return anno[ANNO_CRITERIA]
github eea / eea.facetednavigation / eea / facetednavigation / criteria / handler.py View on Github external
def _update(self, values):
        """ Update criteria
        """
        anno = IAnnotations(self.context)
        anno[ANNO_CRITERIA] = PersistentList(values)
        self.criteria = anno[ANNO_CRITERIA]
    #
github enkore / borgcube / src / borgcube / core / models.py View on Github external
def __init__(self):
        self.repositories = PersistentList()
        # hex archive id -> Archive
        self.archives = OOBTree()
        # client hostname -> Client
        self.clients = OOBTree()

        # job number -> Job
        # note: this tree is the canonical source of job numbers.
        self.jobs = NumberTree()
        # job state (str) -> NumberTree
        self.jobs_by_state = PersistentDefaultDict(factory=LOBTree)

        self.schedules = PersistentList()

        self.trigger_ids = OOBTree()

        self.ext = PersistentDict()
github collective / Products.Poi / Products / Poi / adapters.py View on Github external
def __init__(self, context):
        self.context = context
        annotations = IAnnotations(self.context)
        self.__mapping = annotations.get(self.ANNO_KEY, None)
        if self.__mapping is None:
            self.__mapping = PersistentList()
            annotations[self.ANNO_KEY] = self.__mapping
github plone / plone.restapi / src / plone / restapi / serializer / converters.py View on Github external
@adapter(PersistentList)
@implementer(IJsonCompatible)
def persistent_list_converter(value):
    return list_converter(value)
github indico / indico / indico / MaKaC / review.py View on Github external
def __init__(self):
        self._toList = PersistentList()
        self._ccList = PersistentList()
github EskoSalaka / mtgtools / mtgtools / PSetList.py View on Github external
def __add__(self, other):
        if isinstance(other, PSetList):
            return PSetList(self.sets + other.sets)
        elif isinstance(other, (PersistentList, list, tuple)):
            return PSetList(self.sets + other)
        elif isinstance(other, PSet):
            new_sets = PersistentList(self.sets)
            new_sets.append(other)
            return PSetList(new_sets)
        else:
            raise TypeError
github indico / indico / indico / MaKaC / review.py View on Github external
def __init__(self, abstract, track, responsible, propTracks, answers):
        AbstractJudgement.__init__(self, abstract, track, responsible, answers)
        self._proposedTracks = PersistentList( propTracks )
github indico / indico / indico / MaKaC / registration.py View on Github external
def _initStandardPersonalData(self):
        self._data = PersistentMapping()
        self._sortedKeys = PersistentList()
        p = PersonalDataFormItem({'id':'title', 'name': _("Title"), 'input':'list', 'mandatory':False})
        self._data[p.getId()] = p
        self._sortedKeys.append(p.getId())
        p = PersonalDataFormItem({'id':'firstName', 'name': _("First Name"), 'input':'text', 'mandatory':True})
        self._data[p.getId()] = p
        self._sortedKeys.append(p.getId())
        p = PersonalDataFormItem({'id':'surname', 'name': _("Surname"), 'input':'text', 'mandatory':True})
        self._data[p.getId()] = p
        self._sortedKeys.append(p.getId())
        p = PersonalDataFormItem({'id':'position', 'name': _("Position"), 'input':'text', 'mandatory':False})
        self._data[p.getId()] = p
        self._sortedKeys.append(p.getId())
        p = PersonalDataFormItem({'id':'institution', 'name': _("Institution"), 'input':'text', 'mandatory':True})
        self._data[p.getId()] = p
        self._sortedKeys.append(p.getId())
        p = PersonalDataFormItem({'id':'address', 'name': _("Address"), 'input':'text', 'mandatory':False})