This is the first step a command interpreter to manage our AirBnB objects towards building our first full web application: the AirBnB clone. We will use what we built in this project with all other following projects: HTML/CSS templating, database storage, API, front-end integration…
About
- We put in place a parent class (called
BaseModel
) to take care of the initialization, serialization and deserialization of your future instances - We created a simple flow of serialization/deserialization: Instance <-> Dictionary <-> JSON string <-> file
- we created all classes used for AirBnB (
User
,State
,City
,Place
…) that inherit fromBaseModel
- We created the first abstracted storage engine of the project: File storage.
- We created all unittests to validate all our classes and storage engine
No. | File | File Hierarchy | Description |
---|---|---|---|
1 | console.py | The main console, command interpreter (EOF, all, create, destroy, help, quit, show, update.) | |
2 | Authors | File with the name of Authors | |
3 | README.md | Readme file proyect | |
4 | 'init.py' | models/init.py | File to mark a directory as a package |
5 | amenity.py | models/amenity.py | The amenity subclass |
6 | base_model.py | models/base_model.py | Defines all common attributes/methods for other classes |
7 | city.py | models/city.py | The city subclass |
8 | place.py | models/place.py | The place subclass |
9 | review.py | models/review.py | The review subclass |
10 | state.py | models/state.py | The state subclass |
11 | user.py | models/user.py | The user subclass |
12 | init.py | models/engine/init.py | File to mark a directory as a package |
13 | file_storage.py | models/engine/file_storage.py | The file storage class |
14 | test_amenity.py | tests/test_models/test_amenity.py | The unittest module for amenity |
15 | test_base_model.py | tests/test_models/base_model.py | The unittest module for base model |
16 | test_city.py | tests/test_models/city.py | The unittest module for city |
17 | test_place.py | tests/test_models/place.py | The unittest module for place |
18 | test_review.py | tests/test_models/review.py | The unittest module for review |
19 | test_state.py | tests/test_models/state.py | The unittest module for state |
20 | test_user.py | tests/test_models/user.py | The unittest module for user |
21 | 'init.py' | tests/test_models/test_engine/init.py | File to mark a directory as a package |
22 | test_file_storage.py | tests/test_models/test_engine/test_file_storage.py | The unittest module for file storage |
The console in interactive mode:
/holbertonschool-AirBnB_clone# ./console.py
(hbnb) help
Documented commands (type help ):
========================================
EOF all create destroy help quit show update
(hbnb)
To use in non-interactive mode:
/holbertonschool-AirBnB_clone# echo "help" | ./console.py
(hbnb)
Documented commands (type help ):
========================================
EOF all create destroy help quit show update
(hbnb)
help command use:
(hbnb)
(hbnb) help destroy
Deletes an instance based on the
class name and id, and saves the change into
the JSON file.
(hbnb) help EOF
Exit command to exit the program
(hbnb)
Instructions on how to use them in your own application are linked below.
Command | Description |
---|---|
Quit | Quit the Prompt |
Help | Display help the console |
Create | Create New object |
Show | Show the info object |
All | Display All objects |
Update | Update objects |
Destroy | Destroy Objects |
Crystal Carrillo 6108@holbertonstudents.com
Carlos Alarcon 6138@holbertonstudents.com