rql_download.hooks.CWSearchAdd¶
-
class
rql_download.hooks.
CWSearchAdd
(req, event, **kwargs)[source]¶ CubicWeb hook that is called before adding the new CWSearch entity.
Methods
__init__
(req, event, **kwargs)check_events
()critical
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘CRITICAL’. cw_propval
(propid)return cw property value associated to key debug
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘DEBUG’. error
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘ERROR’. exception
(msg, *args, **kwargs)Convenience method for logging an ERROR with exception information. filterable_selectors
(*args, **kwargs)info
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘INFO’. warning
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘WARNING’. Attributes
category
eidfrom
eidto
entity
events
known_args
order
repo
rtype
-
__call__
()[source]¶ Before adding the CWSearch entity, create a ‘rset’ and a ‘result.json’ File entities that contain all the filepath attached to the current rql request. Filepath are found by patching the rql request with the declared ‘rqldownload-adaptors’ actions. The ‘__rset_type__’ adaptor attribute is used to export the rset.
When an ‘ecsvexport’ is used, no file are then attached in the ‘result.json’ file.
Warning
For the moment we assume the database intergrity (ie. all file paths inserted in the db exist on the file system) and thus do not check to speed up the hook.
-
__module__
= 'rql_download.hooks'¶
-
__regid__
= 'rqldownload.search_add_hook'¶
-
_find_constant_nodes
(nodes, constant_nodes)[source]¶ Method that finds all leaf entity constant nodes.
Parameters: nodes: rql.Nodes (mandatory) :
the rql structure.
constant_nodes: dict of list of 2-uplet of the form (str, str) :
a dict with element types as key containing a list of constant nodes. Each item of the list is a 2-uplet that contains the entity name and the rql corresponding variable name.
-
events
= ('before_add_entity',)¶
-