forked from jzamora5/AirBnB_clone_v3
-
Notifications
You must be signed in to change notification settings - Fork 2
/
review.py
executable file
·24 lines (21 loc) · 726 Bytes
/
review.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
""" holds class Review"""
import models
from models.base_model import BaseModel, Base
from os import getenv
import sqlalchemy
from sqlalchemy import Column, String, ForeignKey
class Review(BaseModel, Base):
"""Representation of Review """
if models.storage_t == 'db':
__tablename__ = 'reviews'
place_id = Column(String(60), ForeignKey('places.id'), nullable=False)
user_id = Column(String(60), ForeignKey('users.id'), nullable=False)
text = Column(String(1024), nullable=False)
else:
place_id = ""
user_id = ""
text = ""
def __init__(self, *args, **kwargs):
"""initializes Review"""
super().__init__(*args, **kwargs)