Created
May 29, 2011 09:54
-
-
Save gijs/997618 to your computer and use it in GitHub Desktop.
Neo4j graph model with Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j.model import django_model as models | |
class Movie(models.NodeModel): | |
title = models.Property(indexed=True) | |
year = models.Property() | |
href = property(lambda self: ('movie/%s/' % (self.node.id,))) | |
def __unicode__(self): | |
return self.title | |
class Actor(models.NodeModel): | |
name = models.Property(index=True) | |
href = property(lambda self: ('/actor/%s/' % | |
(self.node.id,))) | |
def __unicode__(self): | |
return self.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment