Last active
February 12, 2017 07:48
-
-
Save romaintha/de96b536d591f4f41bb5a88c7e43fe34 to your computer and use it in GitHub Desktop.
Example of tweet model using Neomodel
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
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