statezero 0.1.0b13__tar.gz → 0.1.0b14__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.
- {statezero-0.1.0b13 → statezero-0.1.0b14}/PKG-INFO +1 -1
- {statezero-0.1.0b13 → statezero-0.1.0b14}/pyproject.toml +1 -1
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/schemas.py +2 -2
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/ast_parser.py +13 -2
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/config.py +2 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero.egg-info/PKG-INFO +1 -1
- {statezero-0.1.0b13 → statezero-0.1.0b14}/README.md +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/license.md +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/requirements.txt +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/setup.cfg +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/actions.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/apps.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/config.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/context_manager.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/event_emitters.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/exception_handler.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/extensions/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/extensions/custom_field_serializers/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/extensions/custom_field_serializers/file_fields.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/extensions/custom_field_serializers/money_field.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/f_handler.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/helpers.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/middleware.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/migrations/0001_initial.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/migrations/0002_delete_modelviewsubscription.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/migrations/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/orm.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/permissions.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/query_optimizer.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/search_providers/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/search_providers/basic_search.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/search_providers/postgres_search.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/serializers.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/urls.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/views.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/__init__.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/actions.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/ast_validator.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/classes.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/context_storage.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/event_bus.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/event_emitters.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/exceptions.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/hook_checks.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/interfaces.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/process_request.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/core/types.py +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero.egg-info/SOURCES.txt +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero.egg-info/dependency_links.txt +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero.egg-info/requires.txt +0 -0
- {statezero-0.1.0b13 → statezero-0.1.0b14}/statezero.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: statezero
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0b14
|
|
4
4
|
Summary: Connect your Python backend to a modern JavaScript SPA frontend with 90% less complexity.
|
|
5
5
|
Author-email: Robert <robert.herring@statezero.dev>
|
|
6
6
|
Project-URL: homepage, https://www.statezero.dev
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "statezero"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.0b14"
|
|
8
8
|
description = "Connect your Python backend to a modern JavaScript SPA frontend with 90% less complexity."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -41,9 +41,9 @@ class DjangoSchemaGenerator(AbstractSchemaGenerator):
|
|
|
41
41
|
all_field_names: Set[str] = set()
|
|
42
42
|
db_field_names: Set[str] = set()
|
|
43
43
|
|
|
44
|
-
if model_config.
|
|
44
|
+
if model_config.frontend_fields != "__all__":
|
|
45
45
|
all_fields = [
|
|
46
|
-
field for field in all_fields if field.name in model_config.
|
|
46
|
+
field for field in all_fields if field.name in model_config.frontend_fields
|
|
47
47
|
]
|
|
48
48
|
|
|
49
49
|
for field in all_fields:
|
|
@@ -386,8 +386,19 @@ class ASTParser:
|
|
|
386
386
|
|
|
387
387
|
# If any permission allows all fields
|
|
388
388
|
if fields == "__all__":
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
# NEW: For read operations, default "__all__" to frontend_fields
|
|
390
|
+
if operation_type == "read":
|
|
391
|
+
# If frontend_fields is also "__all__", then return all fields
|
|
392
|
+
if model_config.frontend_fields == "__all__":
|
|
393
|
+
return all_fields
|
|
394
|
+
# Otherwise, use frontend_fields as the default for "__all__"
|
|
395
|
+
else:
|
|
396
|
+
fields = model_config.frontend_fields
|
|
397
|
+
fields &= all_fields # Ensure fields actually exist
|
|
398
|
+
allowed_fields |= fields
|
|
399
|
+
else:
|
|
400
|
+
# For create/update operations, "__all__" means truly all fields
|
|
401
|
+
return all_fields
|
|
391
402
|
# Add allowed fields from this permission
|
|
392
403
|
else: # Ensure we're not operating on the string "__all__"
|
|
393
404
|
fields &= all_fields # Ensure fields actually exist
|
|
@@ -181,6 +181,7 @@ class ModelConfig:
|
|
|
181
181
|
searchable_fields: Optional[Union[Set[str], Literal["__all__"]]] = None,
|
|
182
182
|
ordering_fields: Optional[Union[Set[str], Literal["__all__"]]] = None,
|
|
183
183
|
fields: Optional[Union[Set[str], Literal["__all__"]]] = None,
|
|
184
|
+
frontend_fields: Optional[Union[Set[str], Literal["__all__"]]] = None,
|
|
184
185
|
display: Optional[Any] = None,
|
|
185
186
|
DEBUG: bool = False,
|
|
186
187
|
):
|
|
@@ -195,6 +196,7 @@ class ModelConfig:
|
|
|
195
196
|
self.searchable_fields = searchable_fields or set()
|
|
196
197
|
self.ordering_fields = ordering_fields or set()
|
|
197
198
|
self.fields = fields or "__all__"
|
|
199
|
+
self.frontend_fields = frontend_fields or self.fields
|
|
198
200
|
self.display = display
|
|
199
201
|
self.DEBUG = DEBUG or False
|
|
200
202
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: statezero
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0b14
|
|
4
4
|
Summary: Connect your Python backend to a modern JavaScript SPA frontend with 90% less complexity.
|
|
5
5
|
Author-email: Robert <robert.herring@statezero.dev>
|
|
6
6
|
Project-URL: homepage, https://www.statezero.dev
|
|
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
|
{statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/search_providers/__init__.py
RENAMED
|
File without changes
|
{statezero-0.1.0b13 → statezero-0.1.0b14}/statezero/adaptors/django/search_providers/basic_search.py
RENAMED
|
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
|