def __call__(self, *args, **kwargs): query = kwargs.get("query") if not args: args = [self._rfield] if query is not None: del kwargs["query"] else: return self.select(*args, **kwargs) return Set.__call__(self, query).select(*args, **kwargs)
def __init__(self, db, query, rfield, model, rid, via, **kwargs): self._rfield = rfield self._model = model self._rid = rid self._via = via Set.__init__(self, db, query, **kwargs)
def __call__(self, query=None, **kwargs): if query is None: return self.select(self._rfield, **kwargs) return Set.__call__(self, query).select(**kwargs)