def retrieve(self, pks, other_pks=None):
        '''
        Retrieve fetches the object based on the following pk logic:
        if 'other' pks are not found, just use the pk list (coming from URLS)
        assuming their order is already correct
        if 'other' pks are found, then use the class keys to
        get the correct order of pks, look them up
        '''

        if not other_pks:
            newargs = list(pks)
        else:
            newargs = [
                other_pks[key]
                for key in class_keys(self.cls) if key in other_pks
            ]

            # Confirm this logic works!!!
            # will the order be correct if we just append?
            newargs.extend(list(reversed(pks)))

        return self.session.query(self.cls).get(newargs)
dataset/ETHPy150Open dealertrack/djangorest-alchemy/djangorest_alchemy/managers.py/AlchemyModelManager.retrieve/original