Code Monkey home page Code Monkey logo

py-actor-manager's Introduction

Actor manager

Read the guideline before starting.

In this task, you should create a manager for the dataclass Actor.

1. Create dataclass inside models.py module

Actor should have the following attributes:

  • id - unique identifier for each actor
  • first_name - actor's first name
  • last_name - actor's last name

2. Create database

Create a database cinema where will be stored entries with data about different actors and actresses. Create a table actors with corresponding columns. Now, you are ready to create a manager.

3. Create manager inside managers.py module

Create ActorManager class that should provide CRUD operations. It should create a connection to the database inside the constructor. The manager should have the following methods:

  • create - a method that creates a new entry in the actors table with given properties.
  • all - a method that returns a list of Actor instances from DB
  • update - a method that updates properties for entry with given id
  • delete - a method that deletes entry with given id from DB

4. Test

Test different methods in the main.py module.

Note: Check your code using this checklist before pushing your solution.

py-actor-manager's People

Contributors

abnormaltype avatar danylott avatar ivanramyk avatar nattalli avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.