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.
Files changed (40) hide show
  1. {half_orm-1.0.0rc15/half_orm.egg-info → half_orm-1.0.0rc16}/PKG-INFO +1 -1
  2. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/model.py +1 -0
  3. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/utils.py +12 -2
  4. half_orm-1.0.0rc16/half_orm/version.txt +1 -0
  5. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16/half_orm.egg-info}/PKG-INFO +1 -1
  6. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/pyproject.toml +1 -1
  7. half_orm-1.0.0rc15/half_orm/version.txt +0 -1
  8. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/AUTHORS +0 -0
  9. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/LICENSE +0 -0
  10. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/README.md +0 -0
  11. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/__init__.py +0 -0
  12. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/__main__.py +0 -0
  13. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/cli.py +0 -0
  14. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/cli_utils.py +0 -0
  15. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/field.py +0 -0
  16. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/field_errors.py +0 -0
  17. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/fkey.py +0 -0
  18. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/hotest.py +0 -0
  19. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/migrations/BREAKING_CHANGES-1.0.0.md +0 -0
  20. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/migrations/__init__.py +0 -0
  21. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/model_errors.py +0 -0
  22. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/null.py +0 -0
  23. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/pg_meta.py +0 -0
  24. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/py.typed +0 -0
  25. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/relation.py +0 -0
  26. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/relation_errors.py +0 -0
  27. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/relation_factory.py +0 -0
  28. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/sql_adapter.py +0 -0
  29. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/sql_ast.py +0 -0
  30. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/testing.py +0 -0
  31. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm/transaction.py +0 -0
  32. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/SOURCES.txt +0 -0
  33. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/dependency_links.txt +0 -0
  34. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/entry_points.txt +0 -0
  35. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/requires.txt +0 -0
  36. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/half_orm.egg-info/top_level.txt +0 -0
  37. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/setup.cfg +0 -0
  38. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/test/test_cli.py +0 -0
  39. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/test/test_main.py +0 -0
  40. {half_orm-1.0.0rc15 → half_orm-1.0.0rc16}/test/test_sql_ast.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: half_orm
3
- Version: 1.0.0rc15
3
+ Version: 1.0.0rc16
4
4
  Summary: A database-first ORM for PostgreSQL
5
5
  Author-email: Joël Maïzi <joel.maizi@collorg.org>
6
6
  License: GPL-3.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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: half_orm
3
- Version: 1.0.0rc15
3
+ Version: 1.0.0rc16
4
4
  Summary: A database-first ORM for PostgreSQL
5
5
  Author-email: Joël Maïzi <joel.maizi@collorg.org>
6
6
  License: GPL-3.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
4
4
 
5
5
  [project]
6
6
  name = "half_orm"
7
- version = "1.0.0rc15"
7
+ version = "1.0.0rc16"
8
8
  description = "A database-first ORM for PostgreSQL"
9
9
  readme = "README.md"
10
10
  license = { text = "GPL-3.0" }
@@ -1 +0,0 @@
1
- 1.0.0rc15
File without changes
File without changes
File without changes
File without changes