equal
deleted
inserted
replaced
16 from logilab.mtconverter import TransformData, TransformError, xml_escape |
16 from logilab.mtconverter import TransformData, TransformError, xml_escape |
17 |
17 |
18 from rql import parse |
18 from rql import parse |
19 from rql.utils import rqlvar_maker |
19 from rql.utils import rqlvar_maker |
20 |
20 |
21 from cubicweb import Unauthorized |
21 from cubicweb import Unauthorized, typed_eid |
22 from cubicweb.rset import ResultSet |
22 from cubicweb.rset import ResultSet |
23 from cubicweb.selectors import yes |
23 from cubicweb.selectors import yes |
24 from cubicweb.appobject import AppObject |
24 from cubicweb.appobject import AppObject |
25 from cubicweb.rqlrewrite import RQLRewriter |
25 from cubicweb.rqlrewrite import RQLRewriter |
26 from cubicweb.schema import RQLVocabularyConstraint, RQLConstraint, bw_normalize_etype |
26 from cubicweb.schema import RQLVocabularyConstraint, RQLConstraint, bw_normalize_etype |
336 def has_eid(self): |
336 def has_eid(self): |
337 """return True if the entity has an attributed eid (False |
337 """return True if the entity has an attributed eid (False |
338 meaning that the entity has to be created |
338 meaning that the entity has to be created |
339 """ |
339 """ |
340 try: |
340 try: |
341 int(self.eid) |
341 typed_eid(self.eid) |
342 return True |
342 return True |
343 except (ValueError, TypeError): |
343 except (ValueError, TypeError): |
344 return False |
344 return False |
345 |
345 |
346 def is_saved(self): |
346 def is_saved(self): |