Higher-level programming ― AirBnB clone
learn how to build a full web application: the 'AirBnB clone'
- All python files are interpreted/compiled on Ubuntu 14.04 LTS using python3 (version 3.4.3) and use the PEP 8 style (version 1.7.*) for checking coding style
To use, first download this repository into your local machine by issuing the following command in your local terminal.
git clone https://github.com/thrownblown/AirBnB_clone.git
$./console.py
(hbnb) <command>
$ echo "<command>" | ./console.py
$./console.py
(hbnb) all BaseModel
["[BaseModel] (49faff9a-6318-451f-87b6-910505c55907) {'created_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'id': '49faff9a-6318-451f-87b6-910505c55907', 'updated_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903300)}"]
| command | desc |
|---|---|
| help | display help information |
| quit | exit the program |
| Ctrl+D | exit the program |
| create <class Name> | create a new instance/object |
| all | Prints all string representation of all instances |
| all <class Name> | Prints all string representation of all instances based on the class name |
| <class Name>.all() | display all the object of the class |
| show <class Name> <id> | Prints the string representation of an instance based on the class name and id |
| <class Name>.show(<id>) | Prints the string representation of an instance based on the class name and id |
| destroy <class Name> <id> | Deletes an instance based on the class name and id |
| <class Name>.destroy(<id>) | Deletes an instance based on the class name and id |
| update <class Name> <id> <attr name> <attr value> | Updates an instance based on the class name and id by adding or updating attribute |
| <class Name>.update(<id>, <attr name>, "<attr value>") | Updates an instance based on the class name and id by adding or updating attribute |
| <class Name>.update(<id>, {<attr name>: "<attr value>", <attr name>: "<attr value>"}) | Updates an instance based on the class name and id with dictionary |
| <class name>.count() | retrieve the number of instances of a class |
| Directory | File Hierarchy | Description |
|---|---|---|
| root | console.py | The main console file |
| models | click this to see the file description of models | This directory contains all the class and subclass modules. |
| tests | click this to see the file description of tests | This directory contains unit tests files for testing all files in models |
| web_static | click this to see the file description of web_static | The second step of the AirBnB Clone project - build the front end step-by-step |
- Sumin Yu - Twitter: @3_sumin
- Alex Farioletti - Twitter: @ThrownBlown
