(cls, user, resource_id, value)
Get a related entity.
Get a related entity.
Get a related entity .
def get(cls, user, resource_id, value):
        """Get a related entity."""
        kwargs = {'user_id': user.user_id,
                  'resource_id': resource_id,
                  cls._pkey_name: value}
        try:
            obj = cls._model_class.get(**kwargs)
            return cls(obj)
        except Exception as exc:
            log.exception('Unexpected error during retrieve of resource %s'
                          % exc)
            return None
def get ( cls , user , resource_id , value ) : kwargs = { 'user_id' : user . user_id , 'resource_id' : resource_id , cls . _pkey_name : value } try : obj = cls . _model_class . get ( * * kwargs ) return cls ( obj ) except Exception as exc : log . exception ( 'Unexpected error during retrieve of resource %s' % exc ) return None