safeshield 1.2.0__py3-none-any.whl → 1.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: safeshield
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Library for Help Validation Control
5
5
  Home-page: https://github.com/WunsunTarniho/py-guard
6
6
  Author: Wunsun Tarniho
@@ -60,3 +60,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
60
60
 
61
61
  ## v1.2.0 (2024-07-20)
62
62
  - Fixed: Bug connect database to Odoo.
63
+
64
+ ## v1.2.1 (2024-07-20)
65
+ - Fixed: Bug unique and exist rule.
66
+
67
+ ## v1.2.2 (2024-07-20)
68
+ - Fixed: Error when connect use postgres.
@@ -4,8 +4,8 @@ validator/factory.py,sha256=bImQNLhEJg5VTxtHiMYVb2EbHWvimTDqHq-UcA8uolw,812
4
4
  validator/core/__init__.py,sha256=ZcqlXJSk03i_CVzmIN-nVe1UOyvwwO5jhbEj7f62Y_o,59
5
5
  validator/core/validator.py,sha256=00qVnbH-EJC5KALlaoUBLAfsszAFLcoSxfRbmy0amyk,12751
6
6
  validator/database/__init__.py,sha256=O-cB6-MhNapJ3iwe5jvifbMfr1dPjXLtEdfNTKIu0hc,171
7
- validator/database/detector.py,sha256=xAiQ8KcwGRMa8B2Hniq7doVJdnhhyHJT6b7ArmQD4hw,10106
8
- validator/database/manager.py,sha256=Ezz4NUh22Hz2puh-NJggSGCaw3lAGyp3V88plMeBBVU,6232
7
+ validator/database/detector.py,sha256=Vac7oVL26GjU6expGo01-6mgUtXqldr-jirzpYokZBM,9597
8
+ validator/database/manager.py,sha256=XJM_I0WaWfZWV710duAc32p1gtiP2or-MAj75WPw1oM,6478
9
9
  validator/rules/__init__.py,sha256=nDE3qoI82qJTCbILLUWkXuwsMOmsDtB1m-3IGIvRfpY,919
10
10
  validator/rules/array.py,sha256=tx8FCDqn-27Vs7tgtjeoCE9ceDMVrdBEb2-pq-lNLuo,2809
11
11
  validator/rules/base.py,sha256=hrGESfkdvqZrQ1yIK_ftVVOMUuyvNFoz-_qaqUucSy8,3474
@@ -24,8 +24,8 @@ validator/services/rule_error_handler.py,sha256=MGvvkP6hbZLpVXxC3xpzg15OmVdPlk7l
24
24
  validator/services/rule_preparer.py,sha256=jRcMNjqq2xyZjO64Pim8jWmja5DmTzf0V_uuHG0lJTg,5621
25
25
  validator/utils/__init__.py,sha256=Yzo-xv285Be-a233M4duDdYtscuHiuBbPSX_C8yViJI,20
26
26
  validator/utils/string.py,sha256=0YACzeEaWNEOR9_7O9A8D1ItIbtWfOJ8IfrzcB8VMYA,515
27
- safeshield-1.2.0.dist-info/LICENSE,sha256=qugtRyKckyaks6hd2xyxOFSOYM6au1N80pMXuMTPvC4,1090
28
- safeshield-1.2.0.dist-info/METADATA,sha256=R6G1aBEM_-2wwRe5bwL19bQHPlTTgjt3o9LBl4dAjFA,1780
29
- safeshield-1.2.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
30
- safeshield-1.2.0.dist-info/top_level.txt,sha256=iUtV3dlHOIiMfLuY4pruY00lFni8JzOkQ3Nh1II19OE,10
31
- safeshield-1.2.0.dist-info/RECORD,,
27
+ safeshield-1.2.2.dist-info/LICENSE,sha256=qugtRyKckyaks6hd2xyxOFSOYM6au1N80pMXuMTPvC4,1090
28
+ safeshield-1.2.2.dist-info/METADATA,sha256=Da-A5dUfizYqEpszV6KlIwRLJLgKj7KThQ_990k2wNg,1912
29
+ safeshield-1.2.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
30
+ safeshield-1.2.2.dist-info/top_level.txt,sha256=iUtV3dlHOIiMfLuY4pruY00lFni8JzOkQ3Nh1II19OE,10
31
+ safeshield-1.2.2.dist-info/RECORD,,
@@ -61,17 +61,9 @@ class DatabaseAutoDetector:
61
61
  from odoo.tools import config
62
62
  from odoo.http import request
63
63
 
64
- print({
65
- 'type': 'postgresql', # Odoo selalu menggunakan PostgreSQL
66
- 'host': config['db_host'] or 'localhost',
67
- 'port': str(config['db_port'] or 5432),
68
- 'username': config['db_user'] or 'odoo',
69
- 'password': config['db_password'] or '',
70
- 'database': config['db_name'] or request.db,
71
- }, 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee')
72
64
  return {
73
- 'type': 'postgresql', # Odoo selalu menggunakan PostgreSQL
74
- 'host': config['db_host'],
65
+ 'type': 'postgresql',
66
+ 'host': config['db_host'] or '',
75
67
  'port': str(config['db_port'] or 5432),
76
68
  'username': config['db_user'] or 'odoo',
77
69
  'password': config['db_password'] or '',
@@ -46,7 +46,12 @@ class DatabaseManager:
46
46
  self.connect()
47
47
  cursor = None
48
48
  try:
49
- cursor = self.connection.cursor(dictionary=True)
49
+ if self._connection_params['type'] == 'postgresql':
50
+ from psycopg2.extras import RealDictCursor
51
+ cursor = self.connection.cursor(cursor_factory=RealDictCursor)
52
+ else:
53
+ cursor = self.connection.cursor(dictionary=True)
54
+
50
55
  yield cursor
51
56
  finally:
52
57
  if cursor: