half-orm 1.0.0rc15__tar.gz → 1.0.0rc16__tar.gz
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.
- {half_orm-1.0.0rc15/half_orm.egg-info → half_orm-1.0.0rc16}/PKG-INFO +1 -1
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/model.py +1 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/utils.py +12 -2
- half_orm-1.0.0rc16/half_orm/version.txt +1 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16/half_orm.egg-info}/PKG-INFO +1 -1
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/pyproject.toml +1 -1
- half_orm-1.0.0rc15/half_orm/version.txt +0 -1
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/AUTHORS +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/LICENSE +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/README.md +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/__init__.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/__main__.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/cli.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/cli_utils.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/field.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/field_errors.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/fkey.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/hotest.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/migrations/BREAKING_CHANGES-1.0.0.md +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/migrations/__init__.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/model_errors.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/null.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/pg_meta.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/py.typed +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/relation.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/relation_errors.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/relation_factory.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/sql_adapter.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/sql_ast.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/testing.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/transaction.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/SOURCES.txt +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/dependency_links.txt +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/entry_points.txt +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/requires.txt +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/top_level.txt +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/setup.cfg +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/test/test_cli.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/test/test_main.py +0 -0
- {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/test/test_sql_ast.py +0 -0
|
@@ -172,6 +172,7 @@ class Model:
|
|
|
172
172
|
if reload:
|
|
173
173
|
self.__schema_generation += 1
|
|
174
174
|
self._classes_[self._dbname] = {}
|
|
175
|
+
self.__deja_vu[self.__dbname] = self
|
|
175
176
|
self.__thread_local.conn = conn
|
|
176
177
|
self.__thread_local.schema_generation = self.__schema_generation
|
|
177
178
|
if self.__dbname not in self.__class__.__deja_vu:
|
|
@@ -45,15 +45,25 @@ def write(file_, data, mode='w'):
|
|
|
45
45
|
with open(file_, mode=mode, encoding='utf-8') as text_io_wrapper:
|
|
46
46
|
return text_io_wrapper.write(data)
|
|
47
47
|
|
|
48
|
-
def error(msg: str, exit_code: int=None):
|
|
48
|
+
def error(msg: str, exit_code: int=None, show_caller: bool=False):
|
|
49
49
|
"Write error message on stderr and exit if exit is not None"
|
|
50
50
|
sys.stderr.write(f'{Color.bold("half-orm ERROR")}: {Color.red(msg)}')
|
|
51
|
+
if show_caller:
|
|
52
|
+
caller = get_caller_info()
|
|
53
|
+
if caller:
|
|
54
|
+
sys.stderr.write(f' {caller["filename"]}:{caller["lineno"]}, in {caller["function"]}\n'
|
|
55
|
+
f' {caller["code_context"]}\n')
|
|
51
56
|
if exit_code:
|
|
52
57
|
sys.exit(exit_code)
|
|
53
58
|
|
|
54
|
-
def warning(msg: str, context="half-orm"):
|
|
59
|
+
def warning(msg: str, context="half-orm", show_caller: bool=False):
|
|
55
60
|
"Write warning message on stderr"
|
|
56
61
|
sys.stderr.write(f'{Color.bold(context + " WARNING")}: {msg}')
|
|
62
|
+
if show_caller:
|
|
63
|
+
caller = get_caller_info()
|
|
64
|
+
if caller:
|
|
65
|
+
sys.stderr.write(f' {caller["filename"]}:{caller["lineno"]}, in {caller["function"]}\n'
|
|
66
|
+
f' {caller["code_context"]}\n')
|
|
57
67
|
|
|
58
68
|
class TraceDepth: #pragma: no coverage
|
|
59
69
|
"Trace dept class"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0rc16
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.0rc15
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|