core-framework 0.12.12__tar.gz → 0.12.13__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.
- {core_framework-0.12.12 → core_framework-0.12.13}/PKG-INFO +1 -1
- {core_framework-0.12.12 → core_framework-0.12.13}/core/__init__.py +1 -1
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/operations.py +2 -15
- {core_framework-0.12.12 → core_framework-0.12.13}/pyproject.toml +1 -1
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_issues_fixes.py +40 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/.gitignore +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/README.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/app.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/backends.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/base.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/decorators.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/hashers.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/helpers.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/middleware.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/models.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/permissions.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/schemas.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/tokens.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/auth/views.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/choices.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/cli/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/cli/main.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/config.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/database.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/datetime.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/dependencies.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/deployment/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/deployment/docker.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/deployment/kubernetes.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/deployment/pm2.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/exceptions.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/fields.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/avro.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/base.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/config.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/confluent/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/confluent/consumer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/confluent/producer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/decorators.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/kafka/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/kafka/admin.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/kafka/broker.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/kafka/consumer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/kafka/producer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/rabbitmq/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/rabbitmq/broker.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/rabbitmq/consumer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/rabbitmq/producer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/redis/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/redis/broker.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/redis/consumer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/redis/producer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/registry.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/topics.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/messaging/workers.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/middleware.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/analyzer.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/cli.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/engine.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/migration.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/migrations/state.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/models.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/permissions.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/querysets.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/relations.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/routing.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/serializers.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/base.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/config.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/decorators.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/registry.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/scheduler.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tasks/worker.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/tenancy.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/assertions.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/client.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/database.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/factories.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/mocks.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/testing/plugin.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/validation.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/validators.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/core/views.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/01-quickstart.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/02-viewsets.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/03-authentication.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/04-messaging.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/05-multi-service.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/06-tasks.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/07-deployment.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/08-complete-example.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/09-settings.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/10-migrations.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/11-permissions.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/12-auth-backends.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/13-validators.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/14-querysets.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/15-routing.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/16-serializers.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/17-datetime.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/18-dependencies.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/19-views.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/20-fields.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/21-tenancy.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/22-replicas.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/23-soft-delete.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/24-relations.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/25-exceptions.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/26-choices.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/27-workers.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/28-avro.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/29-topics.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/30-changelog-0.12.2.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/31-middleware.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/32-migration-guide-0.12.2.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/32-testing.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/33-changelog-0.12.3.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/99-faq-troubleshooting.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/GUIDE.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/docs/README.md +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/example/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/example/app.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/example/auth.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/example/models.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/example/schemas.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/example/views.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/libs/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/main.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/__init__.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/conftest.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_auth_helpers.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_imports.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_models.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_permissions.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_querysets.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_serializers.py +0 -0
- {core_framework-0.12.12 → core_framework-0.12.13}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-framework
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.13
|
|
4
4
|
Summary: Core Framework - Django-inspired, FastAPI-powered. Alta performance, baixo acoplamento, produtividade extrema.
|
|
5
5
|
Project-URL: Homepage, https://github.com/SorPuti/core-framework
|
|
6
6
|
Project-URL: Documentation, https://github.com/SorPuti/core-framework#readme
|
|
@@ -260,23 +260,10 @@ class CreateTable(Operation):
|
|
|
260
260
|
return f"Create table '{self.table_name}'"
|
|
261
261
|
|
|
262
262
|
def to_code(self) -> str:
|
|
263
|
-
|
|
264
|
-
"""Serializa valor default para código Python válido."""
|
|
265
|
-
if val is None:
|
|
266
|
-
return "None"
|
|
267
|
-
if callable(val):
|
|
268
|
-
# Funções como datetime.utcnow não podem ser serializadas
|
|
269
|
-
# Usamos None e deixamos o banco lidar com o default
|
|
270
|
-
return "None"
|
|
271
|
-
if isinstance(val, str):
|
|
272
|
-
return f"'{val}'"
|
|
273
|
-
if isinstance(val, bool):
|
|
274
|
-
return str(val)
|
|
275
|
-
return repr(val)
|
|
276
|
-
|
|
263
|
+
# Use global _serialize_default for consistent callable serialization
|
|
277
264
|
cols = ",\n ".join(
|
|
278
265
|
f"ColumnDef(name='{c.name}', type='{c.type}', nullable={c.nullable}, "
|
|
279
|
-
f"default={
|
|
266
|
+
f"default={_serialize_default(c.default)}, primary_key={c.primary_key}, "
|
|
280
267
|
f"autoincrement={c.autoincrement}, unique={c.unique})"
|
|
281
268
|
for c in self.columns
|
|
282
269
|
)
|
|
@@ -211,6 +211,46 @@ class TestIssue5MigrationSerialization:
|
|
|
211
211
|
result = _serialize_default(lambda: None)
|
|
212
212
|
# Should not contain <function
|
|
213
213
|
assert "<function" not in result
|
|
214
|
+
|
|
215
|
+
def test_add_column_to_code_with_callable(self):
|
|
216
|
+
"""AddColumn.to_code() should serialize callable defaults correctly."""
|
|
217
|
+
from core.migrations.operations import AddColumn, ColumnDef
|
|
218
|
+
from core.datetime import timezone
|
|
219
|
+
|
|
220
|
+
col = ColumnDef(
|
|
221
|
+
name="created_at",
|
|
222
|
+
type="DATETIME",
|
|
223
|
+
nullable=False,
|
|
224
|
+
default=timezone.now,
|
|
225
|
+
)
|
|
226
|
+
op = AddColumn(table_name="users", column=col)
|
|
227
|
+
|
|
228
|
+
code = op.to_code()
|
|
229
|
+
|
|
230
|
+
# Should NOT contain <function ... at 0x...>
|
|
231
|
+
assert "<function" not in code
|
|
232
|
+
assert "0x" not in code
|
|
233
|
+
# Should be valid Python (can be exec'd)
|
|
234
|
+
assert "AddColumn" in code
|
|
235
|
+
|
|
236
|
+
def test_create_table_to_code_with_callable(self):
|
|
237
|
+
"""CreateTable.to_code() should serialize callable defaults correctly."""
|
|
238
|
+
from core.migrations.operations import CreateTable, ColumnDef
|
|
239
|
+
from core.datetime import timezone
|
|
240
|
+
|
|
241
|
+
cols = [
|
|
242
|
+
ColumnDef(name="id", type="INTEGER", primary_key=True),
|
|
243
|
+
ColumnDef(name="created_at", type="DATETIME", default=timezone.now),
|
|
244
|
+
]
|
|
245
|
+
op = CreateTable(table_name="test_table", columns=cols)
|
|
246
|
+
|
|
247
|
+
code = op.to_code()
|
|
248
|
+
|
|
249
|
+
# Should NOT contain <function ... at 0x...>
|
|
250
|
+
assert "<function" not in code
|
|
251
|
+
assert "0x" not in code
|
|
252
|
+
# Should contain proper reference
|
|
253
|
+
assert "CreateTable" in code
|
|
214
254
|
|
|
215
255
|
|
|
216
256
|
class TestIssue6ResetDbCascade:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|