-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
77 lines (45 loc) · 1.99 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from product.product import Product
from product.productsRepository import ProductsRepository
from user.user import User
from user.usersRepository import UsersRepository
product_repository1 = ProductsRepository()
product_repository1.create({"name": "orhidee", "price": 60, "quantity": 3})
product_repository1.create({"name": "crin", "price": 15, "quantity": 2})
product_repository1.create({"name": "trandafir", "price": 50, "quantity": 10})
# product_repository1.read(1)
# product_repository1.read(2)
# product_repository1.read(3)
# product_repository1.read(4)
# product_repository1.read(10)
# product_repository1.read(3)
# print("---" * 25)
#
# product_repository1.update(3, {"name": "bujor", "price": 10, "quantity": 5})
#
# product_repository1.read(3)
# product_repository1.read(2)
# print("---" * 25)
# product_repository1.delete(2)
# print("---" * 25)
# product_repository1.read(2)
# print("---" * 25)
# product_repository1.read(1)
#
# product_repository1.update(1, {"name": "lalea", "price": 9, "quantity": 29})
# print("---" * 25)
# product_repository1.read(1)
user_repository1 = UsersRepository()
user_repository1.create({"username": "primul_utilizator", "email": "[email protected]", "password": "12345"})
user_repository1.create({"username": "user2", "email": "[email protected]", "password": "abc123"})
user_repository1.create({"username": "user3", "email": "[email protected]", "password": "qwerty123"})
# user_repository1.read(1)
# user_repository1.read(2)
# user_repository1.read(3)
# user_repository1.read(0)
# user_repository1.update(1, {"username": "primul_utilizator", "email": "[email protected]", "password": "12345"})
# user_repository1.delete(0)
# user_repository1.read(1)
# user_repository1.update(1, "username": "primul_utilizator", "email": "[email protected]", "password": "12345")
# user_repository1.read(1)
# product_repository1.update(3, {"nume": "bujor", "price": 10, "quantity": 5})
# TEMA: sa nu ne mai dea erori - pentru "nume" in loc de "name"