Giter Site home page Giter Site logo

airbnb_clone's Introduction

0x00. AirBnB clone - The console

Background Context

Welcome to the AirBnB clone project!

Airbnb

First step: Write a command interpreter to manage your AirBnB objects.

This is the first step towards building full web application: the AirBnB clone. we will use what you build during this project with all other following projects: HTML/CSS templating, database storage, API, front-end integration

Python

console is used to interact with this AirBnb clone instead of frontend

cosole

Usage

How to use it

$ ./console.py

this will start command line interpeter

(hbnb) 

Now you have to use commands to ineract with console

command help will display availaple commands

(hbnb) help

Documented commands (type help <topic>):
========================================
EOF  all  create  destroy  help  quit  show  update

Examples

(hbnb) all
[]
(hbnb) create BaseModel
3ea9e8ed-f850-472a-ae23-46fc744130bb
(hbnb) all
["[BaseModel] (3ea9e8ed-f850-472a-ae23-46fc744130bb) {'id': '3ea9e8ed-f850-472a-ae23-46fc744130bb', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826440), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826458)}"]
(hbnb) show BaseModel 3ea9e8ed-f850-472a-ae23-46fc744130bb
[BaseModel] (3ea9e8ed-f850-472a-ae23-46fc744130bb) {'id': '3ea9e8ed-f850-472a-ae23-46fc744130bb', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826440), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826458)}
(hbnb) create User
fb008a1d-299a-4d6e-a5be-de76115d4d6e
(hbnb) all
["[BaseModel] (3ea9e8ed-f850-472a-ae23-46fc744130bb) {'id': '3ea9e8ed-f850-472a-ae23-46fc744130bb', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826440), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826458)}", "[User] (fb008a1d-299a-4d6e-a5be-de76115d4d6e) {'id': 'fb008a1d-299a-4d6e-a5be-de76115d4d6e', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 47, 844566), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 47, 844581)}"]
(hbnb) all BaseModel
["[BaseModel] (3ea9e8ed-f850-472a-ae23-46fc744130bb) {'id': '3ea9e8ed-f850-472a-ae23-46fc744130bb', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826440), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826458)}"]
(hbnb) all User
["[User] (fb008a1d-299a-4d6e-a5be-de76115d4d6e) {'id': 'fb008a1d-299a-4d6e-a5be-de76115d4d6e', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 47, 844566), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 47, 844581)}"]
(hbnb) update User fb008a1d-299a-4d6e-a5be-de76115d4d6e my_name "A. Hesham"
(hbnb) all User
["[User] (fb008a1d-299a-4d6e-a5be-de76115d4d6e) {'id': 'fb008a1d-299a-4d6e-a5be-de76115d4d6e', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 47, 844566), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 47, 844581), 'my_name': 'A. Hesham'}"]
(hbnb) destroy User fb008a1d-299a-4d6e-a5be-de76115d4d6e
(hbnb) all
["[BaseModel] (3ea9e8ed-f850-472a-ae23-46fc744130bb) {'id': '3ea9e8ed-f850-472a-ae23-46fc744130bb', 'created_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826440), 'updated_at': datetime.datetime(2023, 8, 12, 8, 59, 11, 826458)}"]
(hbnb) help

Documented commands (type help <topic>):
========================================
EOF  all  create  destroy  help  quit  show  update

(hbnb) help show
 show an instance(obj) of input class by
        Id given by user
        Like get resource by ID in any web API

        format : show BaseModel {id : int}
        example : show BaseModel 1234-1234-1234
        this will show an instance of BaseModel class

(hbnb) quit

airbnb_clone's People

Contributors

abdalmohsen-h avatar thekingstar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.