cubicweb/pyramid/resources.py
changeset 12567 26744ad37953
parent 11967 83739be20fab
child 12911 a17cbf539a69
equal deleted inserted replaced
12566:6b3523f81f42 12567:26744ad37953
    17 #
    17 #
    18 # You should have received a copy of the GNU Lesser General Public License along
    18 # You should have received a copy of the GNU Lesser General Public License along
    19 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    19 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    20 
    20 
    21 """Pyramid resource definitions for CubicWeb."""
    21 """Pyramid resource definitions for CubicWeb."""
    22 
       
    23 from six import text_type
       
    24 
    22 
    25 from rql import TypeResolverException
    23 from rql import TypeResolverException
    26 
    24 
    27 from pyramid.decorator import reify
    25 from pyramid.decorator import reify
    28 from pyramid.httpexceptions import HTTPNotFound
    26 from pyramid.httpexceptions import HTTPNotFound
    60                 rset = req.execute(st.as_string(), {'x': int(self.value)})
    58                 rset = req.execute(st.as_string(), {'x': int(self.value)})
    61             except (ValueError, TypeResolverException):
    59             except (ValueError, TypeResolverException):
    62                 # conflicting eid/type
    60                 # conflicting eid/type
    63                 raise HTTPNotFound()
    61                 raise HTTPNotFound()
    64         else:
    62         else:
    65             rset = req.execute(st.as_string(), {'x': text_type(self.value)})
    63             rset = req.execute(st.as_string(), {'x': self.value})
    66         return rset
    64         return rset
    67 
    65 
    68 
    66 
    69 class ETypeResource(object):
    67 class ETypeResource(object):
    70 
    68