This is the first step towards building our first full web application: an AirBnB clone. This first step consists of a custom command-line interface for data management. This console will be used to manage the objects of our AirBnB clone project. The console will be a tool to validate and verify the functionality of the project.
The console can be run both interactively and non-interactively. The console can be run by executing the following command:
./console.py
The console can also be run non-interactively by piping a command into the console. For example:
echo "help" | ./console.py
The console supports the following commands:
EOF
- Exits the consolequit
- Exits the consolehelp
- Displays the help messagecreate
- Creates a new instance of a classshow
- Displays the string representation of an instancedestroy
- Deletes an instanceall
- Displays all instances of a classupdate
- Updates an instance
The following are examples of how to use the console:
(hbnb) create BaseModel
(hbnb) show BaseModel 1234-1234-1234
(hbnb) destroy BaseModel 1234-1234-1234
(hbnb) all BaseModel
(hbnb) update BaseModel 1234-1234-1234 name "John Doe"
The following are the contents of the project:
console.py
- The consolebase_model.py
- The base model classuser.py
- The user classstate.py
- The state classcity.py
- The city classamenity.py
- The amenity classplace.py
- The place classreview.py
- The review class__init__.py
- The initialization filefile_storage.py
- The file storage classtests/
- The directory containing the unit testsmodels/
- The directory containing the classes
There are no known bugs at the time of release.