Hi,

I used neo4j.py to create a simple nodespace, and was able to use the
index to index and find nodes.  When I tried to define a traversal
class to search for nodes, though, I ran into a problem.  I'm not sure
how to import neo4j.Traversal.  Take the example from the wiki
http://components.neo4j.org/neo4j.py/ :
****
class Hackers(neo4j.Traversal):
    types = [
        neo4j.Outgoing.knows,
        neo4j.Outgoing.coded_by,
        ]
    order = neo4j.DEPTH_FIRST
    stop = neo4j.STOP_AT_END_OF_GRAPH

    def isReturnable(self, position):
        return (not position.is_start
                and position.last_relationship.type == 'coded_by')

****

If I put an "import neo4j" at the top of the file, it says at runtime:
AttributeError: 'module' object has no attribute 'Traversal'.  I took
a look at the source, but don't understand how to import the Traversal
class so that it can be used (it's defined in _traversal.py, inside of
the initialize function).

Thanks,
Brian
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to