gnowledge/gstudio — pull request #272 by AvadootNachankar (2014-03-13 17:00:10+00:00)
Title: Implemented function - returns possible relations (inverse-relations as well) of a given node (or list of nodes).

Files updated:

1) models.py
* get_possible_relations() function added to RelationType class
- It is a static method (can directly access it using class name)
- Returns possible relations and inverse-relations of a given node (or list of nodes) as a tuple consisting of two dictionaries, each consisting of key as ObjectId of relation-type-node and value as relation-type-node itself where:
- Dictionary #1: Possible relations
- Dictionary #2: Possible inverse-relations

* GRelation class updated
- Renamed following:
1) relation_type_value to relation_type
2) object_value to right_subject

- Modified - relation_type: RelationType # To embed RelationType class doccument

- Added - use_autorefs = True # To support embedding of documents

* Triple class updated
- Added - Built-in save() function, overridden to create version(rcs) files

NOTE: While searching from Triple, use following syntax:
- collection.Triple.find() -- as this is different from collection.Node.find()
- Just to avoid changed structure-format of documents.