Esempio n. 1
0
 def __init__(self, *args, **kw):
     rdb_key = directive.key.bind().get(self)
     if rdb_key:
         keyfunc = lambda node:getattr(node, rdb_key)
     elif hasattr(self, 'keyfunc'):
         keyfunc = self.keyfunc
     else:
         keyfunc = default_keyfunc
     MappedCollection.__init__(self, keyfunc=keyfunc)
Esempio n. 2
0
    def __init__(self, column_name):
        # Whether the collection is currently being used for a parent's
        # relationship attribute or not.
        self.linked = False

        # Useful references, that will be obtained upon linking.
        self.parent_obj = None
        self.child_cls = None
        self.child_rel_name = None
        self.child_rel_prop = None
        self.child_key_name = column_name

        MappedCollection.__init__(self, lambda x: getattr(x, column_name))
Esempio n. 3
0
    def __init__(self, column_name):
        # Whether the collection is currently being used for a parent's
        # relationship attribute or not.
        self.linked = False

        # Map the id() of values to their key. This is well defined
        # because we ensure uniqueness of values (as the key is a
        # function of the value: the attribute we're mapping from).
        # This speeds up key retrieval.
        self.inverse_map = dict()

        self.event_wrapper = None

        # Useful references, that will be obtained upon linking.
        self.child_cls = None
        self.child_rel_name = None
        self.child_rel_prop = None
        self.child_key_name = column_name

        MappedCollection.__init__(self, lambda x: getattr(x, column_name))
Esempio n. 4
0
    def __init__(self, column_name):
        # Whether the collection is currently being used for a parent's
        # relationship attribute or not.
        self.linked = False

        # Map the id() of values to their key. This is well defined
        # because we ensure uniqueness of values (as the key is a
        # function of the value: the attribute we're mapping from).
        # This speeds up key retrieval.
        self.inverse_map = dict()

        self.event_wrapper = None

        # Useful references, that will be obtained upon linking.
        self.child_cls = None
        self.child_rel_name = None
        self.child_rel_prop = None
        self.child_key_name = column_name

        MappedCollection.__init__(self, lambda x: getattr(x, column_name))
Esempio n. 5
0
 def __init__(self, *args, **kw):
     MappedCollection.__init__(self, keyfunc=lambda obj: obj.category)
     OrderedDict.__init__(self, *args, **kw)
Esempio n. 6
0
 def __init__(self, *args, **kw):
     MappedCollection.__init__(self, keyfunc=lambda p: p.email_address)
     OrderedDict.__init__(self, *args, **kw)
Esempio n. 7
0
 def __init__(self, *args, **kw):
     MappedCollection.__init__(self, keyfunc=lambda p: p.email_address)
     OrderedDict.__init__(self, *args, **kw)
Esempio n. 8
0
 def __init__(self):
     MappedCollection.__init__(self, keyfunc=lambda node: node.project_id)
Esempio n. 9
0
 def __init__(self, keyfunc, *args, **kwargs):
     MappedCollection.__init__(self, keyfunc=keyfunc)
     OrderedDict.__init__(self, *args, **kwargs)
Esempio n. 10
0
 def __init__(self, keyfunc, *args, **kwargs):
     MappedCollection.__init__(self, keyfunc=keyfunc)
     OrderedDict.__init__(self, *args, **kwargs)
Esempio n. 11
0
 def __init__(self, *args, **kw):
     MappedCollection.__init__(self, keyfunc=lambda widget: widget.widget_identifier)
     OrderedDict.__init__(self, *args, **kw)
Esempio n. 12
0
 def __init__(self, *args, **kw):
     MappedCollection.__init__(self, keyfunc=lambda span: span.span_name)
     OrderedDict.__init__(self, *args, **kw)
Esempio n. 13
0
 def __init__(self, *args, **kw):
     MappedCollection.__init__(self, keyfunc=default_keyfunc)
Esempio n. 14
0
 def __init__(self, keyfunc):
     MappedCollection.__init__(self, keyfunc)
     OrderedDict.__init__(self) #@UndefinedVariable
Esempio n. 15
0
 def __init__(self):
     MappedCollection.__init__(self, keyfunc=lambda node: node.project_id)