This team project is part of the AlX Software Engineer program. It's the first step towards building a first full web application: an AirBnB clone. This first step consists of a custom command-line interface simulating data management, and the base classes for the storage of data.
The console is a Unix shell-like command line user interface provided by the python CmdModule It prints a prompt and waits for the user for input, for our project we used (hbnb)
Command | Example |
---|---|
Display commands help | (hbnb) help <command> |
Create object (prints its id) | (hbnb) create <class> |
Destroy object | (hbnb) destroy <class> <id> or (hbnb) <class>.destroy(<id>) |
Show object | (hbnb) show <class> <id> or (hbnb) <class>.show(<id>) |
Show "all" objects or instances class | (hbnb) all or (hbnb) all <class> |
Run console | ./console.py |
Quit console | (hbnb) quit |
Help command example
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF all count create destroy help quit show update
File | Description | Attributes |
---|---|---|
base_model.py | The BaseModel class is inherited by other classes | id, created_at, updated_at |
user.py | User class stores user-related info | email, password, first_name, last_name |
city.py | City class stores city-specific information | state_id, name |
state.py | State class stores state-specific information | name |
place.py | Place class stores full detailed outline of rental unit features | city_id, user_id, name, description, number_rooms, number_bathrooms, max_guest, price_by_night, latitude, longitude, amenity_ids |
review.py | Review class stores previous customer reviews and opinions | place_id, user_id, text |
amenity.py | Amenity class stores highlighted amenity information | name |
All the code is tested with the unittest module. The test for the classes are in the test_models folder.
- Oscar Tiego - Github profile
- Fredrick Onyango - Github profile