forked from feliciahsieh/AirBnB_clone_v3
-
Notifications
You must be signed in to change notification settings - Fork 2
/
review.py
executable file
·31 lines (28 loc) · 924 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
25
26
27
28
29
30
31
#!/usr/bin/python3
""" holds class Review"""
import models
from models.base_model import BaseModel, Base
from os import getenv
import sqlalchemy
from sqlalchemy import Column, String
from sqlalchemy.orm import relationship
from sqlalchemy import ForeignKey
class Review(BaseModel, Base):
"""Representation of Review """
if getenv('HBNB_TYPE_STORAGE') == 'db':
__tablename__ = 'reviews'
text = Column(String(1024),
nullable=False)
place_id = Column(String(60),
ForeignKey('places.id'),
nullable=False)
user_id = Column(String(60),
ForeignKey('users.id'),
nullable=False)
else:
text = ""
place_id = ""
user_id = ""
def __init__(self, *args, **kwargs):
"""initializes Review"""
super().__init__(*args, **kwargs)