server/sources/__init__.py
changeset 6142 8bc6eac1fac1
parent 6057 cb5c8852cbda
child 6162 76bd320c5ace
equal deleted inserted replaced
6141:b8287e54b528 6142:8bc6eac1fac1
    24 from logging import getLogger
    24 from logging import getLogger
    25 
    25 
    26 from cubicweb import set_log_methods, server
    26 from cubicweb import set_log_methods, server
    27 from cubicweb.schema import VIRTUAL_RTYPES
    27 from cubicweb.schema import VIRTUAL_RTYPES
    28 from cubicweb.server.sqlutils import SQL_PREFIX
    28 from cubicweb.server.sqlutils import SQL_PREFIX
       
    29 from cubicweb.server.ssplanner import EditedEntity
    29 
    30 
    30 
    31 
    31 def dbg_st_search(uri, union, varmap, args, cachekey=None, prefix='rql for'):
    32 def dbg_st_search(uri, union, varmap, args, cachekey=None, prefix='rql for'):
    32     if server.DEBUG & server.DBG_RQL:
    33     if server.DEBUG & server.DBG_RQL:
    33         print '  %s %s source: %s' % (prefix, uri, union.as_string())
    34         print '  %s %s source: %s' % (prefix, uri, union.as_string())
   341         This method must return the an Entity instance representation of this
   342         This method must return the an Entity instance representation of this
   342         entity.
   343         entity.
   343         """
   344         """
   344         entity = self.repo.vreg['etypes'].etype_class(etype)(session)
   345         entity = self.repo.vreg['etypes'].etype_class(etype)(session)
   345         entity.eid = eid
   346         entity.eid = eid
       
   347         entity.cw_edited = EditedEntity(entity)
   346         return entity
   348         return entity
   347 
   349 
   348     def after_entity_insertion(self, session, lid, entity):
   350     def after_entity_insertion(self, session, lid, entity):
   349         """called by the repository after an entity stored here has been
   351         """called by the repository after an entity stored here has been
   350         inserted in the system table.
   352         inserted in the system table.