equal
deleted
inserted
replaced
1 """Contains resources classes. |
1 """Contains resources classes. |
2 """ |
2 """ |
|
3 from six import text_type |
3 |
4 |
4 from rql import TypeResolverException |
5 from rql import TypeResolverException |
5 |
6 |
6 from pyramid.decorator import reify |
7 from pyramid.decorator import reify |
7 from pyramid.httpexceptions import HTTPNotFound |
8 from pyramid.httpexceptions import HTTPNotFound |
39 rset = req.execute(st.as_string(), {'x': int(self.value)}) |
40 rset = req.execute(st.as_string(), {'x': int(self.value)}) |
40 except (ValueError, TypeResolverException): |
41 except (ValueError, TypeResolverException): |
41 # conflicting eid/type |
42 # conflicting eid/type |
42 raise HTTPNotFound() |
43 raise HTTPNotFound() |
43 else: |
44 else: |
44 rset = req.execute(st.as_string(), {'x': unicode(self.value)}) |
45 rset = req.execute(st.as_string(), {'x': text_type(self.value)}) |
45 return rset |
46 return rset |
46 |
47 |
47 |
48 |
48 class ETypeResource(object): |
49 class ETypeResource(object): |
49 |
50 |