def get(self, ident): prop = self.property_name if self._criterion: mapper = self._only_full_mapper_zero("get") # Don't use getattr/hasattr to check public existence, since this # might misinterpret a bug (AttributeError raised by some code in # property implementation) as missing attribute and cause all # private data going to public. if prop in dir(mapper.class_): crit = getattr(mapper.class_, prop) if crit is not None: if not isinstance(crit, ClauseElement): # This simplest safe way to make bare boolean column # accepted as expression. crit = cast(crit, Boolean) if crit!=self._criterion: # We can't verify that criterion is from our private() # call. Check from DB instead of looking in identity # map. assert False # XXX temporal to verify it's used return Query.get(self.populate_existing(), ident) assert False # XXX temporal to verify it's used obj = Query.get(self, ident) if obj is not None and (prop not in dir(obj) or getattr(obj, prop)): return obj
def get(self, ident): prop = self.property_name if self._criterion: # pragma: no cover mapper = self._only_full_mapper_zero("get") # Don't use getattr/hasattr to check public existence, since this # might misinterpret a bug (AttributeError raised by some code in # property implementation) as missing attribute and cause all # private data going to public. if prop in dir(mapper.class_): crit = getattr(mapper.class_, prop) if crit is not None: if not isinstance(crit, ClauseElement): # This simplest safe way to make bare boolean column # accepted as expression. crit = cast(crit, Boolean) if crit != self._criterion: # We can't verify that criterion is from our private() # call. Check from DB instead of looking in identity # map. assert False # XXX temporal to verify it's used return Query.get(self.populate_existing(), ident) assert False # XXX temporal to verify it's used obj = Query.get(self, ident) if obj is not None and (prop not in dir(obj) or getattr(obj, prop)): return obj
def get(self, ident): # override get() so that the flag is always checked in the # DB as opposed to pulling from the identity map. return Query.get(self.populate_existing(), ident)
def get(self, ident): obj = Query.get(self, ident) if obj is not None and getattr(obj, 'public', True): return obj
def get(self, ident): # override get() so that the flag is always checked in the # DB as opposed to pulling from the identity map. - this is optional. return Query.get(self.populate_existing(), ident)