@Ostoyae and I are building an Airbnb clone. This first repo is the console for object management.
๐ฅ Create - Handles creating instances of objects such as Users, Places, Reviews, etc.
๐ถ Retrieve - Handles reading data from a file or database such as finding users who staying in Toyko this week.
๐ง Update - Handles changing data/features such as adding a user to a host's home.
๐ฎ Destroy - Handles removal of objects such as deleting an inappropriate review.
๐ Do - Handles general operations such as calculating average review, trip price, etc.
- Ubuntu 14.04 LTS - OS
- Python3.4.3 - Language
- pip3 - Package Manager
- PEP 8 - Style Guide
- Install Script - Installation Script
- See examples of use for interactive vs. non-interactive mode
Supported commands:
EOF
- exits consolequit
- exits console<emptyline>
- overwrites default emptyline method and does nothingcreate
- Creates a new instance ofBaseModel
, saves it (to the JSON file) and prints the iddestroy
- Deletes an instance based on the class name and id (save the change into the JSON file).show
- Prints the string representation of an instance based on the class name and id.all
- Prints all string representation of all instances based or not on the class name.update
- Updates an instance based on the class name and id by adding or updating attribute (save the change into the JSON file).
โ AirBnB_clone git:(master) โ/console.py
(hbnb) helpDocumented commands (type help <topic>):
========================================
EOF all create destroy help quit show update(hbnb) all MyModel
** class doesn't exist **
(hbnb) create BaseModel
bf183ab2-3719-477f-87a7-22f0209b0653
(hbnb) all BaseModel
[[BaseModel] (bf183ab2-3719-477f-87a7-22f0209b0653) {'created_
at': datetime.datetime(2019, 2, 20, 16, 8, 57, 823535), 'update
d_at': datetime.datetime(2019, 2, 20, 16, 8, 57, 823535), 'id':
'bf183ab2-3719-477f-87a7-22f0209b0653'}]
(hbnb) show BaseModel bf183ab2-3719-477f-87a7-22f0209b0653
[BaseModel] (bf183ab2-3719-477f-87a7-22f0209b0653) {'created_at
': datetime.datetime(2019, 2, 20, 16, 8, 57, 823535), 'updated_
at': datetime.datetime(2019, 2, 20, 16, 8, 57, 823535), 'id': '
bf183ab2-3719-477f-87a7-22f0209b0653'}
(hbnb) destroy BaseModel bf183ab2-3719-477f-87a7-22f0209b0653
(hbnb) show BaseModel d094af47-b450-4cef-92ae-84f3c975b183
** no instance found **
(hbnb) quit
None known at the this time. Please open a case should you find any.
-
Connor Brereton - @ConnorBrereton
-
Martin Smith - @Ostoyae
This project is licensed under the MIT License - see the LICENSE.md file for details