This project aim to make a clone of the AirBnB from scratch, in few steps. Please visit https://github.com/Rd-Feng/AirBnB_clone_v2 for continue development.
This console is written in Python3, and will be used to do CRUD operations (Create, Read, Update, Delete) on our AirBnB objects (User, City, Review, etc.). More information on the models will be described in the later section.
At the moment, we have 7 models: BaseModel, User, State, City, Amenity, Place, and Review, each instance of which is given:
- a unique id generated using
uuid
package - the attribute
created_at
, adatetime
object, indicating when the object is created - the attribute
updated_at
, adatetime
object, indicating when the object is last updated - the attribute
__class__
, astr
object, indicating what is the object's type (model)
Other attributes will be given based on the model:
- User
- first_name:
str
object - last_name:
str
object - password:
str
object - email:
str
- first_name:
- State
- name:
str
object
- name:
- City
- state_id:
str
object - name:
str
object
- state_id:
- Amenity
- name:
str
object
- name:
- Place
- city_id:
str
object - user_id:
str
object - name:
str
object - description:
str
object - number_rooms:
int
object - number_bathrooms:
int
object - max_guest:
int
object - price_by_night:
int
object - latitude:
float
object - longitude:
float
object - amenity_ids:
list
object
- city_id:
- Review
- place_id:
str
object - user_id:
str
object - text: `str object
- place_id:
Run ./console
at the root directory of the repo to start the console
Create an object of type <type>
. id
of the newly created object will be printed after creation.
Update the attribute attribute name
of the object specified by the object id
with value attribute value
.
Delete an object of type
with id object id
Display an of type type
with id object id
Display all objects of type type
. If type
is not specified, display all objects.
Show help information of command
. If command
is not specified, display all documented commands.
Stephen Chu [email protected]
Rui Feng [email protected]