Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@romaintha
romaintha / tweet_neo4j_model.py
Last active February 12, 2017 07:48
Example of tweet model using Neomodel
class Tweet(neomodel.StructuredNode):
id_str = neomodel.StringProperty(unique_index=True, required=True)
created_at = neomodel.DateTimeProperty(required=False)
retweeted = neomodel.BooleanProperty(required=False)
text = neomodel.StringProperty(required=False)
lang = neomodel.StringProperty(required=False)
retweets = neomodel.RelationshipTo('Tweet', 'RETWEETS')
mentions = neomodel.RelationshipTo('User', 'MENTIONS')
replies = neomodel.RelationshipTo('Tweet', 'REPLIES')