equal
deleted
inserted
replaced
1266 |
1266 |
1267 Example (in a shell session): |
1267 Example (in a shell session): |
1268 |
1268 |
1269 >>> c = rql('Any X WHERE X is Company').get_entity(0, 0) |
1269 >>> c = rql('Any X WHERE X is Company').get_entity(0, 0) |
1270 >>> p = rql('Any X WHERE X is Person').get_entity(0, 0) |
1270 >>> p = rql('Any X WHERE X is Person').get_entity(0, 0) |
1271 >>> c.set(name=u'Logilab') |
1271 >>> c.cw_set(name=u'Logilab') |
1272 >>> p.set(firstname=u'John', lastname=u'Doe', works_for=c) |
1272 >>> p.cw_set(firstname=u'John', lastname=u'Doe', works_for=c) |
1273 |
1273 |
1274 You can also set relations where the entity has 'object' role by |
1274 You can also set relations where the entity has 'object' role by |
1275 prefixing the relation name by 'reverse_'. Also, relation values may be |
1275 prefixing the relation name by 'reverse_'. Also, relation values may be |
1276 an entity or eid, a list of entities or eids, or None (meaning that all |
1276 an entity or eid, a list of entities or eids, or None (meaning that all |
1277 relations of the given type from or to this object should be deleted). |
1277 relations of the given type from or to this object should be deleted). |