-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmodels.py
More file actions
26 lines (22 loc) · 876 Bytes
/
models.py
File metadata and controls
26 lines (22 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Float
from database import Base
class Tweet(Base):
__tablename__ = 'tweets'
id = Column(Integer, primary_key=True)
body = Column(String(1000), nullable=False)
keyword = Column(String(256), nullable=False)
tweet_date = Column(DateTime, nullable=False)
location = Column(String(100))
verified_user = Column(Boolean)
followers = Column(Integer)
sentiment = Column(Float)
def __init__(self, body, keyword, tweet_date, location, verified_user, followers, sentiment):
self.body = body
self.keyword = keyword
self.tweet_date = tweet_date
self.location = location
self.verified_user = verified_user
self.followers = followers
self.sentiment = sentiment
def __repr__(self):
return '<Tweet %r>' % self.body