entity.py
branchstable
changeset 2125 19861294506f
parent 2005 e8032965f37a
child 2144 51c84d585456
child 2312 af4d8f75c5db
equal deleted inserted replaced
2124:5a0b02f37b23 2125:19861294506f
   396         mainattr, needcheck = self._rest_attr_info()
   396         mainattr, needcheck = self._rest_attr_info()
   397         etype = str(self.e_schema)
   397         etype = str(self.e_schema)
   398         path = etype.lower()
   398         path = etype.lower()
   399         if mainattr != 'eid':
   399         if mainattr != 'eid':
   400             value = getattr(self, mainattr)
   400             value = getattr(self, mainattr)
   401             if value is None:
   401             if value is None or unicode(value) == u'':
   402                 mainattr = 'eid'
   402                 mainattr = 'eid'
   403                 path += '/eid'
   403                 path += '/eid'
   404             elif needcheck:
   404             elif needcheck:
   405                 # make sure url is not ambiguous
   405                 # make sure url is not ambiguous
   406                 rql = 'Any COUNT(X) WHERE X is %s, X %s %%(value)s' % (
   406                 rql = 'Any COUNT(X) WHERE X is %s, X %s %%(value)s' % (