

def list(self, other_pks=None, filters=None):
    "\n        List returns back list of URI\n        In case of multiple pks, We guess the pk\n        by using '<modelname>_id' as the field convention\n        "
    try:
        pk = primary_key(self.cls)
    except KeyNotFoundException:
        pk = None
    filter_dict = dict()
    if filters:
        filter_dict = {k: v for (k, v) in filters.items()}
        filter_dict.pop('format', None)
        filter_dict.pop('page', None)
        filter_dict.pop('sort_by', None)
    if other_pks:
        query_pks = dict()
        for key in class_keys(self.cls):
            if (key in other_pks):
                query_pks[key] = other_pks[key]
        query_pks.update(filter_dict)
        if pk:
            queryset = self.session.query(self.cls.__dict__[pk]).filter_by(**query_pks).all()
        else:
            queryset = self.session.query(self.cls).filter_by(**query_pks).all()
    elif filter_dict:
        if pk:
            queryset = self.session.query(self.cls.__dict__[pk]).filter_by(**filter_dict).all()
        else:
            queryset = self.session.query(self.cls).filter_by(**filter_dict).all()
    elif pk:
        queryset = self.session.query(self.cls.__dict__[pk]).all()
    else:
        queryset = self.session.query(self.cls).limit(1000).all()
    return queryset

dataset/ETHPy150Open dealertrack/djangorest-alchemy/djangorest_alchemy/managers.py AlchemyModelManager.list/original