Coder Social home page Coder Social logo

airbnb_clone's Introduction

0x00. AirBnB clone - The console

Description

What you should learn from this project:

  • How to create a Python package
  • How to create a command interpreter in Python using the cmd module
  • What is Unit testing and how to implement it in a large project
  • How to serialize and deserialize a Class
  • How to write and read a JSON file
  • How to manage datetime
  • What is an UUID
  • What is *args and how to use it
  • What is **kwargs and how to use it
  • How to handle named arguments in a function

Write a README.md:

description of the project description of the command interpreter:

how to start it how to use it examples

You should have an AUTHORS file at the root of your repository, listing all individuals having contributed content to the repository. For format, reference Docker’s AUTHORS page Also, we strongly encourage you to use branches and pull requests on Github - it will help you as team to organize your work

  • Write beautiful code that passes the PEP8 checks.
  • All your files, classes, functions must be tested with unit tests
  • Write a class BaseModel that defines all common attributes/methods for other classes:
  • Previously we created a method to generate a dictionary representation of an instance (method to_dict()).
  • Now we can recreate a BaseModel from another one by using a dictionary representation:
  • Write a program called console.py that contains the entry point of the command interpreter:
  • Update your command interpreter (console.py) to have these commands:
  • Write a class User that inherits from BaseModel:
  • Write all those classes that inherit from BaseModel:
  • Update FileStorage to manage correctly serialization and deserialization of all our new classes: Place, State, City, Amenity and Review
  • Update your command interpreter (console.py) to retrieve all instances of a class by using: .all().
  • Update your command interpreter (console.py) to retrieve the number of instances of a class: .count().
  • Update your command interpreter (console.py) to retrieve an instance based on its ID: .show().
  • Update your command interpreter (console.py) to destroy an instance based on his ID: .destroy().
  • Update your command interpreter (console.py) to update an instance based on his ID: .update(, , ).
  • Update your command interpreter (console.py) to update an instance based on his ID with a dictionary: .update(, ).

Author

Console

  • How to start: To begin, please run the file "console.py". ./console.py

Commands:

  • quit No arguments - will exit the console. quit
  • help [command] Can run with no arguments to show what commands there are. Running with an argument (a command) will give you details about that command. help and help quit
  • create <model_name> Will create a new instance of the indicated model, and then print the id of the new object. Accepted models are: BaseModel, User, State, City,
    Amenity, Place, and Review. create BaseModel
  • show <model_name, id> Will show indicated model. show BaseModel 8173-i3880-andn83
  • destroy <model_name, id> Will delete the indicated object. destroy Amenity 9182-8373-8177393
  • all [model_name] Print all currently existing objects to output. If given a model_name, will print all current instances of indicated model. all or all User
  • update <model_name, id, attribute [value (str, int, or float)]> Update the indicated object with the given attribute, which will have the value indicated. update BaseModel 1234-1234-1234 email "[email protected]"

airbnb_clone's People

Contributors

seckmohameth avatar blueexcess avatar

Watchers

James Cloos 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.