31 from rql.utils import rqlvar_maker |
31 from rql.utils import rqlvar_maker |
32 from rql.stmts import Select |
32 from rql.stmts import Select |
33 from rql.nodes import (Not, VariableRef, Constant, make_relation, |
33 from rql.nodes import (Not, VariableRef, Constant, make_relation, |
34 Relation as RqlRelation) |
34 Relation as RqlRelation) |
35 |
35 |
36 from cubicweb import Unauthorized, typed_eid, neg_role |
36 from cubicweb import Unauthorized, neg_role |
37 from cubicweb.utils import support_args |
37 from cubicweb.utils import support_args |
38 from cubicweb.rset import ResultSet |
38 from cubicweb.rset import ResultSet |
39 from cubicweb.appobject import AppObject |
39 from cubicweb.appobject import AppObject |
40 from cubicweb.req import _check_cw_unsafe |
40 from cubicweb.req import _check_cw_unsafe |
41 from cubicweb.schema import (RQLVocabularyConstraint, RQLConstraint, |
41 from cubicweb.schema import (RQLVocabularyConstraint, RQLConstraint, |
625 def has_eid(self): # XXX cw_has_eid |
625 def has_eid(self): # XXX cw_has_eid |
626 """return True if the entity has an attributed eid (False |
626 """return True if the entity has an attributed eid (False |
627 meaning that the entity has to be created |
627 meaning that the entity has to be created |
628 """ |
628 """ |
629 try: |
629 try: |
630 typed_eid(self.eid) |
630 int(self.eid) |
631 return True |
631 return True |
632 except (ValueError, TypeError): |
632 except (ValueError, TypeError): |
633 return False |
633 return False |
634 |
634 |
635 def cw_is_saved(self): |
635 def cw_is_saved(self): |