[Cubicweb] Understanding _cw

Aurélien Campéas aurelien.campeas at logilab.fr
Wed May 14 18:50:03 CEST 2014


On 14/05/2014 18:08, Aurélien Campéas wrote:
[...]
> 
>>>> connection.intersection(clientconnection)
> set(['security_enabled', 'execute', 'rollback', 'drop_entity_cache',
> 'entity_metas', 'call_service', 'deny_all_hooks_but',
> 'cached_entities', 'allow_all_hooks_but', 'set_entity_cache',
> 'system_sql', 'commit', 'source_defs', 'entity_cache'])
> 
[...]

Also the differences are interesting:


>>> clientconnection - connection
set(['get_schema', 'transaction_info', 'describe', 'get_option_value',
'transaction_actions', 'undo_transaction', 'undoable_transactions'])

So the high-level "undo" API is there and only there, along with a few
loners.


>>> connection - clientconnection
set(['ensure_cnx_set', 'disable_hook_categories', 'transaction_uuid',
'read_security', 'rql_rewriter', 'update_rel_cache_del',
'add_relations', 'enable_hook_categories', 'is_hook_activated',
'added_in_transaction', 'deleted_in_transaction',
'transaction_inc_action_counter', 'add_operation',
'ertype_supports_undo', 'delete_relation', 'update_rel_cache_add',
'cnxset', 'data', 'rtype_eids_rdef', 'clear',
'is_hook_category_activated', 'add_relation'])


So I bet the idea is Connection is for the repo & hooks business, and
in general "close to the transaction" stuff.

I don't feel these things are special enough to complicate the life
of the application developper :)


Cheers,
Aurélien.



More information about the Cubicweb mailing list