# HG changeset patch # User Sylvain Thénault # Date 1254928381 -7200 # Node ID 31cb1070bd43eeb3316fe0d1268b871ff544cc7e # Parent 9da934661d6440223762e9955e8b414d710eead1# Parent d77025be6f068242c38a7363a3bc75eac4f631f1 merge diff -r 9da934661d64 -r 31cb1070bd43 __init__.py --- a/__init__.py Wed Oct 07 17:12:40 2009 +0200 +++ b/__init__.py Wed Oct 07 17:13:01 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 = []