Skip to content

Instantly share code, notes, and snippets.

@romaintha
Last active February 12, 2017 07:48
Show Gist options
  • Save romaintha/de96b536d591f4f41bb5a88c7e43fe34 to your computer and use it in GitHub Desktop.
Save romaintha/de96b536d591f4f41bb5a88c7e43fe34 to your computer and use it in GitHub Desktop.
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')
tags = neomodel.RelationshipTo('Hashtag', 'TAGS')
contains = neomodel.RelationshipTo('Link', 'CONTAINS')
quotes = neomodel.Relationship('Tweet', 'QUOTES')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment