Code Monkey home page Code Monkey logo

airbnb_clone's Introduction

AirBnB Clone - The Console

The console is the first segment of the AirBnB project at ALX that will collectively cover fundamental concepts of higher level programming. The goal of AirBnB project is to eventually deploy our server a simple copy of the AirBnB Website(HBnB). A command interpreter is created in this segment to manage objects for the AirBnB(HBnB) website.

Functionalities of this command interpreter: Create a new object (ex: a new User or a new Place) * Retrieve an object from a file, a database etc... * Do operations on objects (count, compute stats, etc...) * Update attributes of an object * Destroy an object

Environment This project is interpreted/compiled on Ubuntu 20.04 LTS using python3 (version 3.8.5)

The command interpreter: console.py - the console contains the entry point of the command interpreter. List of commands this console current supports:

  • EOF - exits console

  • quit - exits console

  • - overwrites default emptyline method and does nothing

  • Create - Creates a new instance ofBaseModel, saves it (to the JSON file) and prints the id

  • Destroy - Deletes an instance based on the class name and id (save the change into the JSON file).

  • Show - Prints the string representation of an instance based on the class name and id.

  • All - Prints all string representation of all instances based or not on the class name.

  • update - Updates an instance based on the class name and id by adding or updating attribute (save the change into the JSON file).

1.) models/ directory contains classes used for this project: base_model.py - The BaseModel class from which future classes will be derived

  • def init(self, *args, **kwargs) - Initialization of the base model
  • def str(self) - String representation of the BaseModel class
  • def save(self) - Updates the attribute updated_at with the current datetime
  • def to_dict(self) - returns a dictionary containing all keys/values of the instance

2.) Classes inherited from Base Model:

  • amenity.py
  • city.py
  • place.py
  • review.py
  • state.py
  • user.py

AUTHURS 1.) EYATU PHILIP ESAMU [email protected] 2.) WAISWA KENNETH [email protected]

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.