Giter VIP home page Giter VIP logo

airbnb_clone's Introduction

AirBnB

A fullstack web application using Python, HTML, CSS, JavaScript.

The Console

A command interpreter to administrate/manage the AirBnB storage and objects, written in Python.

How it works?

After cloning the repository in your host machine run the console.py script

$ python3 AirBnB_clone/console.py

An interactive prompt will appear with the label (hbnb), now you can start doing CRUD operations by commanding (hbnb).

to see all the available commands type help:

(hbnb) help

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

(hbnb)

to see how to use a specific command type help <command>:

(hbnb) help create
usage: create <class>
create an instance of the class
(hbnb)

For example, to create a new User instence:

(hbnb) create User

available classes are User, Place, City, State, Review, Amenity:

the reply for the last command we gave to (hbnb) was:

(hbnb) create User
2e73b834-97cb-4ba9-bc7a-06c95fd84585
(hbnb)

now we have an ID for the new user, we can add other properties using update:

(hbnb) show user 2e73b834-97cb-4ba9-bc7a-06c95fd84585
[User] (2e73b834-97cb-4ba9-bc7a-06c95fd84585) {'id': '2e73b834-97cb-4ba9-bc7a-06c95fd84585', 'created_at': datetime.datetime(2024, 1, 22, 16, 17, 28, 404795), 'updated_at': datetime.datetime(2024, 1, 22, 16, 17, 28, 404795)}
(hbnb) update user 2e73b834-97cb-4ba9-bc7a-06c95fd84585 name Mohammed
(hbnb) update user 2e73b834-97cb-4ba9-bc7a-06c95fd84585 email "[email protected]"
(hbnb) show user 2e73b834-97cb-4ba9-bc7a-06c95fd84585
[User] (2e73b834-97cb-4ba9-bc7a-06c95fd84585) {'id': '2e73b834-97cb-4ba9-bc7a-06c95fd84585', 'created_at': datetime.datetime(2024, 1, 22, 16, 17, 28, 404795), 'updated_at': datetime.datetime(2024, 1, 22, 16, 22, 21, 674695), 'name': 'Mohammed', 'email': '[email protected]'}

and so on we can create other objects, read their properties, update some properties, and delete objects, and that what we refered to with the CRUD operations above.

airbnb_clone's People

Contributors

yahia-soliman avatar ehabw57 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

yahia-soliman

airbnb_clone's Issues

Space missing

Line 53 in console.py missing a space in the error mesg "** class doesn't exist**"

do_all method is'nt well architectured

def do_all(self, arg):
This method in console is not well architectured, instead of using two if statements then call print two times, it could be just one if-else statement With one print line.

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.