skeleton/hooks.py.tmpl
author Yann Voté <yann.vote@logilab.fr>
Wed, 24 Jun 2015 23:23:57 +0200
changeset 10457 1f5026e7d848
parent 8207 c04676b16c59
permissions -rw-r--r--
[dataimport] Move stores to new API. Here is the final store API: * ``prepare_insert_entity(<entity type>, **kwargs) -> eid``: given an entity type, attributes and inlined relations, return the eid of the entity to be inserted, *with no guarantee that anything has been inserted in database*, * ``prepare_update_entity(<entity type>, eid, **kwargs) -> None``: given an entity type and eid, promise for update given attributes and inlined relations *with no guarantee that anything has been inserted in database*, * ``prepare_insert_relation(eid_from, rtype, eid_to) -> None``: indicate that a relation ``rtype`` should be added between entities with eids ``eid_from`` and ``eid_to``. Similarly to ``prepare_insert_entity()``, *there is no guarantee that the relation will be inserted in database*, * ``flush() -> None``: flush any temporary data to database. May be called several times during an import, * ``finish() -> None``: additional stuff to do after import is terminated. **Warning:** ``prepare_update_entity()`` still needs to be implemented for NoHookRQLObjectStore. Related to #5040344
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8207
c04676b16c59 ([config] add file encoding information to python files (closes #1942655)
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents: 5423
diff changeset
     1
# -*- coding: utf-8 -*-
5423
e15abfdcce38 backport default into stable: stable is now cw 3.8
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5184
diff changeset
     2
# copyright %(year)s %(author)s, all rights reserved.
e15abfdcce38 backport default into stable: stable is now cw 3.8
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5184
diff changeset
     3
# contact %(author-web-site)s -- mailto:%(author-email)s
e15abfdcce38 backport default into stable: stable is now cw 3.8
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5184
diff changeset
     4
#
e15abfdcce38 backport default into stable: stable is now cw 3.8
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5184
diff changeset
     5
%(long-license)s
e15abfdcce38 backport default into stable: stable is now cw 3.8
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5184
diff changeset
     6
"""%(distname)s specific hooks and operations"""