Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back-end script to handle the database #21

Open
karastoyanov opened this issue May 10, 2023 · 4 comments
Open

Back-end script to handle the database #21

karastoyanov opened this issue May 10, 2023 · 4 comments
Assignees
Labels
database Postgres DB management

Comments

@karastoyanov
Copy link
Member

karastoyanov commented May 10, 2023

Python script which manages some basic operations:

  • Creates new category/subcategory
  • Insert new products
@karastoyanov karastoyanov self-assigned this May 10, 2023
@karastoyanov karastoyanov converted this from a draft issue May 10, 2023
@karastoyanov karastoyanov added the database Postgres DB management label May 10, 2023
@karastoyanov karastoyanov moved this from Todo to In Progress in First Stable Version - market-app May 10, 2023
@karastoyanov
Copy link
Member Author

Changes to the database:

  • New column added in subcategories --> parent_category

322ef3d

@karastoyanov
Copy link
Member Author

Changes to the database:

  • products table updated with:
    alter table products add column total_value numeric(10, 2) generated always as (single_price * quantity) stored;

  • in products table colums single_price and quantity changed to numeric value

462cf1b

@karastoyanov
Copy link
Member Author

Minor issues fixed with 299d073

@karastoyanov
Copy link
Member Author

Last update: d6fe7f3

Commit is pushed in development branch

  • Comments re-format
  • Integrated init functionality, based on user input
"""INIT THE OPERATION"""
create_new_subcategory()

print("What are you going to do?\n")
print("1.Create a new category\n2.Create a new subcategory\n3.Create a new item\n")
user_input = int(input())


if user_input == 1:
    create_new_category()
elif user_input == 2:
    create_new_subcategory()
elif user_input == 3:
    create_new_items()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Postgres DB management
Projects
Status: In Progress
Development

No branches or pull requests

1 participant