# HG changeset patch # User Alexandre Fayolle # Date 1254928129 -7200 # Node ID d77025be6f068242c38a7363a3bc75eac4f631f1 # Parent 540210e138d323e5224d7b08cbd71f5a23ed630d [doc] added an example of use of create_entity in a shell session diff -r 540210e138d3 -r d77025be6f06 __init__.py --- a/__init__.py Wed Oct 07 15:35:59 2009 +0200 +++ b/__init__.py Wed Oct 07 17:08:49 2009 +0200 @@ -123,7 +123,14 @@ pass def create_entity(self, etype, *args, **kwargs): - """add a new entity of the given type""" + """add a new entity of the given type + + Example (in a shell session): + + c = create_entity('Company', name='Logilab') + create_entity('Person', ('works_for', 'Y'), Y=c.eid, firstname='John', lastname='Doe') + + """ rql = 'INSERT %s X' % etype relations = [] restrictions = []