Code Monkey home page Code Monkey logo

airbnb_clone's Introduction

N|Solid

0x00. AirBnB clone - The console

Description

This the first step to create a command interpreter to manage your AirBnB objects and it calls the console, it allows the users to manage the entities of the system using the commands explained in this manual. The users like the administrator of the Airbnb clone has the posibility of the creating and updating and managing objects and data of the application, those objects are:

  • Users
  • Places
  • States
  • Cities
  • Amenities
  • Reviews

This abstraction will also allow you to change the type of storage easily without updating all of your codebase. The console will be a tool to validate this storage engine.

N|Solid

How to use the console:

To use the console:

  • you can start by running the console.py file:

    ~/AirBnB_clone$ ./console.py
    (hbnb) 
  • (hbnb) help: this is the help command or it can be used next to one of the command for further help:

    (hbnb) help
    
    Documented commands (type help <topic>):
    ========================================
    EOF  all  create  destroy  help  quit  show  update
    
    (hbnb)
  • (hbnb) create <Model's name>: this command can be used to create a model, it returns model's id:

    (hbnb) create BaseModel
    3fc9cd65-b9cb-4895-bfe1-8b63877f0583
    (hbnb)
  • (hbnb) all <Model's name>: this command can be used to display all the existent models:

    (hbnb) all BaseModel
    ["[BaseModel] (3fc9cd65-b9cb-4895-bfe1-8b63877f0583) {'id': '3fc9cd65-b9cb-4895-bfe1-8b63877f0583', 'created_at': datetime.datetime(2023, 12, 9, 22, 21, 32, 216883), 'updated_at': datetime.datetime(2023, 12, 9, 22, 21, 32, 216883)}"]
    (hbnb)
  • (hbnb) show <Model's name> <model's id> : this command follow by the id of the model, display only the content of that specific model:

    (hbnb) show BaseModel 3fc9cd65-b9cb-4895-bfe1-8b63877f0583
    [BaseModel] (3fc9cd65-b9cb-4895-bfe1-8b63877f0583) {'id': '3fc9cd65-b9cb-4895-bfe1-8b63877f0583', 'created_at': datetime.datetime(2023, 12, 9, 22, 21, 32, 216883), 'updated_at': datetime.datetime(2023, 12, 9, 22, 21, 32, 216883)}
    (hbnb)
  • (hbnb) destroy <model's name> <instance's id>: this command can delete a model using it's instance id.

    (hbnb) destroy User 3fc9cd65-b9cb-4895-bfe1-8b63877f0583
    (hbnb) 
  • (hbnb) update BaseModel <model's id> <attribute>: <the new value>: this command can be used to update the value of an attribute using it's id.

  • (hbnb) quit: this command can be used to exit the console.

    (hbnb) quit
    
    ~/AirBnB_clone$ 

AUTHORS

airbnb_clone's People

Contributors

yo-aiv1 avatar zakariasan 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.