PauloMorillo / AirBnB_clone_v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Airbnb clone HBNB

Airbnb is a web platform to rent house, rooms and more. This is the first step
to clone it. In this step we did a console to manage the objects created by the
classes to do easier the way to add, del, destroy and update objects. Also we
use a file JSON to store and persist objects. and obviusly we created our data
model.

Supported classes:

  • BaseModel
  • User
  • State
  • City
  • Amenity
  • Place
  • Review

Commands:

  • create - create an object
  • show - show an object (based on id)
  • destroy - destroy an object
  • all - show all objects, of one type or all types
  • quit/EOF - quit the console
  • help - see descriptions of commands

To start, navigate to the project folder and enter ./console.py in the shell.

Create

create <class name> Ex: create BaseModel

Show

show <class name> <object id> Ex: show User my_id

Destroy

destroy <class name> <object id> Ex: destroy Place my_place_id

All

all or all <class name> Ex: all or all State

Quit

quit or EOF

Help

help or help <command> Ex: help or help quit

Additionally, the console supports <class name>.<command>(<parameters>) syntax. Ex: City.show(my_city_id)

About


Languages

Language:Python 77.3%Language:HTML 13.6%Language:CSS 8.3%Language:Shell 0.8%