easyapi-django 1.35.0__tar.gz → 1.35.2__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.
- {easyapi_django-1.35.0/easyapi_django.egg-info → easyapi_django-1.35.2}/PKG-INFO +3 -1
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/README.md +2 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/base.py +6 -2
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/calc.py +5 -2
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/calc_resource.py +30 -5
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/dashboards/aggregate.py +5 -4
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/dates.py +3 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/authenticator.py +13 -8
- {easyapi_django-1.35.0 → easyapi_django-1.35.2/easyapi_django.egg-info}/PKG-INFO +3 -1
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/pyproject.toml +1 -1
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/LICENSE +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/MANIFEST.in +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/access.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/apps.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/migrations/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/models.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/policy.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/resources.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/settings_helper.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/accounts/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/accounts/creator.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/api_keys.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/auth.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/bearer.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/apps.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/constants.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/management/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/management/commands/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/management/commands/billing.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/migrations/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/models.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/plans.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/resources.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/blocking.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/catalog.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/client_ip.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/constants.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/core/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/core/endpoint.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/core/resource.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/custom.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/custom_models.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/custom_rules.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/dashboards/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/dashboards/compose.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/dashboards/models.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/edge.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/errors.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/exception.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/filters.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/cli.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/config.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/generator.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/inspector/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/inspector/base.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/inspector/mysql.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/inspector/postgres.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/README.md.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/asgi.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/env.example.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/gitignore.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/manage.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/module/models.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/module/resources.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/requirements.txt.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/router/endpoints.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/router/urls.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/run.sh.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/settings/env.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/settings/settings.py.j2 +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/helpers.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/labels/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/labels/management/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/labels/management/commands/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/labels/management/commands/export_labels.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/management/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/management/commands/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/management/commands/mcp_serve.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/protocol.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/schema.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/server.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/testing.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/tool.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/mcp/tools.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/middleware.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/_common.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/apps.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/cimd.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/clients.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/codes.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/consent_csrf.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/constants.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/devices.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/discovery.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/es_ES/LC_MESSAGES/django.mo +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/es_ES/LC_MESSAGES/django.po +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/pt_BR/LC_MESSAGES/django.po +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/logos.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/migrations/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/models.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resolver.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/authorize.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/connections.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/device.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/device_authorization.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/register.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/revoke.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/switch_account.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/token.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/routes.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/session.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/settings_helper.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/templates/easyapi_oauth/consent.html +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/templates/easyapi_oauth/device.html +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/templates/easyapi_oauth/switch_account.html +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/tokens.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/openapi.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/orm/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/partner/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/partner/partner.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/partner/resources.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rate_limit.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/redis_config.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/routes.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/audit.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/cache.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/context.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/errors.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/mcp.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/operations.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/policy.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/registry.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/rest.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/rules.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/selection.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/rules/writes.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/schemas.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/security.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/security_evidence.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/security_log.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/security_store.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/sensitive.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/serializer.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/session.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/settings_helper.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/apps.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/codes.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/constants.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/crypto.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/device.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/federated.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/login.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/migrations/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/models.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/passkey.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/resources.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/settings_helper.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/store.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/signin/two_factor.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/tenant/__init__.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/tenant/db_router.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/tenant/registry.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/tenant/tenant.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/tokens.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/util.py +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi_django.egg-info/SOURCES.txt +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi_django.egg-info/dependency_links.txt +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi_django.egg-info/entry_points.txt +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi_django.egg-info/requires.txt +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi_django.egg-info/top_level.txt +0 -0
- {easyapi_django-1.35.0 → easyapi_django-1.35.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easyapi-django
|
|
3
|
-
Version: 1.35.
|
|
3
|
+
Version: 1.35.2
|
|
4
4
|
Summary: Zero-effort REST API (and MCP server) generator from Django models.
|
|
5
5
|
Author-email: Stamatios Stamou Jr <bushier.outsets.0c@icloud.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -164,6 +164,7 @@ So I cleaned up **easyapi** and put it on GitHub. REST is the core; MCP is an op
|
|
|
164
164
|
|
|
165
165
|
**REST (`BaseResource`)**
|
|
166
166
|
- Async CRUD on Django models with pagination, filters, search, ordering.
|
|
167
|
+
- **`?all=1` lists every row.** No page cut and no `meta`, as `limit=0` does; `page` and `limit` beside it are ignored. `all=0`, `all=false` and an empty value leave paging on. A `Rules` resource stops `all` at the ceiling instead (below).
|
|
167
168
|
- **Strict routes.** An endpoint key is the plain name (`'task'`, `'task/file'`) and matches `task` and `task/...` only, never `tasks` or `task_x`. On it, a path whose tail isn't an id (`/task/undefined`) is a `404` (`easyapi.item_not_found`) on `GET`/`PATCH`/`DELETE`, not the full list. A regex key still works for what a name can't say (`'^logout$'`, `r'^admin/account/\d+/subscription(/.*)?$'`). A loose regex key (`'task(.*)$'`, `'^invoice'`) is refused at startup with `ImproperlyConfigured`, naming the plain key to use.
|
|
168
169
|
- OpenAPI 3.0.3 spec + Scalar UI.
|
|
169
170
|
- Cache with namespace invalidation. Writes don't blow away unrelated rows.
|
|
@@ -543,6 +544,7 @@ Defaults are demo-friendly. Production deployments should:
|
|
|
543
544
|
every route.
|
|
544
545
|
- **`/aggregate` is opt-in.** `get_routes` doesn't mount it unless you pass `aggregate_view=Aggregate` (the generic, unscoped resource — `from easyapi import Aggregate`) or a custom row-scoped subclass. `AGGREGATE_MODELS = ['app_Model', ...]` is mandatory: it lists the models `/aggregate` may query. Without it `get_routes` refuses to boot with `aggregate_view` mounted, and `get_results` answers `403` (`easyapi.aggregate_model_not_allowed`) for every model, with or without `base_queryset` — the body names any model of any installed app, central databases included. References to credential-named columns (in filters, groups, order or calc) are always rejected regardless — the per-resource escape hatch does not reach `/aggregate`. Group values come back as stored (`null`, `""`, `false`, the choice or option value), with the labels of choices (source text) and custom field options in `labels`: `{x, keys}`, or per field with `raw: true`; the text for a null or empty group is up to the UI.
|
|
545
546
|
- **Renamed from `/metrics`.** The endpoint was `/metrics` (`Metrics`, `metrics_view`, `METRICS_*` settings, `easyapi.metrics_*` codes). During the transition `/metrics` answers with the same view as `/aggregate`, `Metrics` and `metrics_view` still work, and each `AGGREGATE_<name>` setting falls back to `METRICS_<name>`; the error codes are already `easyapi.aggregate_*`.
|
|
547
|
+
- **Token scopes apply.** A credential with a scope ceiling (a Bearer token) queries only the models whose `Rules` it may read (`<rules name>:read`, e.g. `contact:read`); a model without `Rules` is refused to it (`403 easyapi.insufficient_scope`), per query in a batch and per series in a `compose`. The screen's session and an API key have no ceiling. A subclass that overrides `resolve` sends each plain query through `query_model(timezone, query)` (the check, then `run_query`).
|
|
546
548
|
- **Batch and stream aggregates.** `POST /aggregate` also takes `{"queries": {"<name>": {...query...}}}` and answers `{"<name>": result}`; a query that fails answers `{"error", "status"}` in its place without failing the others (`403` for a model outside `AGGREGATE_MODELS`, `500` for an unexpected error, logged). With `?stream=1` (or `true`) the batch answers `application/x-ndjson`, one line per query as soon as it is ready (`{"name", "data"}` or `{"name", "error", "status"}`), with `X-Accel-Buffering: no` so nginx does not hold it — a dashboard fills block by block from one request. Queries still run one after another (the ORM is thread-sensitive); the gain is one round trip and early rendering. Bound it: `AGGREGATE_MAX_QUERIES` (default `15`) caps the queries per batch — the rate limiter counts the batch as one request — and a larger batch, or a query that is not an object with `model`, returns `400`. Each failed query counts in the IP's 4xx tripwire like a single failed query; when it trips the batch stops (`403`, or a final blocked line in the stream). To scope rows, override `Aggregate.run_query(timezone, query)` and pass `base_queryset` to `get_results`: it runs every query, single or batched. `Aggregate.resolve(timezone, query)` answers each query and defaults to `run_query`; override it to read the query differently. `dehydrate`/`post_process` apply to the single query only.
|
|
547
549
|
- **Dashboards compose series (optional package).** `from easyapi.dashboards.aggregate import DashboardAggregate` and mount it as `aggregate_view`. A body with `compose: {series: [{name, config}], formula, cumulative, name}` runs each series' `config` as its own aggregate query (through `run_query`, so a scoped subclass scopes every series) and combines them by `x`: up to 4 series (`a`..`d` in the formula), `+ - * /`, parentheses and numbers only, division by zero as `0`, `cumulative` as a running total. All series must be totals or all grouped by one field. Errors are `easyapi.compose_*`.
|
|
548
550
|
- **Bound the aggregate fields, per model.** `AGGREGATE_MODELS` only gates *which models* — every non-credential field on an allowed model is still fair game for `/aggregate` (filter, group, order, calc), including arbitrary FK traversal. Set `AGGREGATE_FIELDS = {'app_Model': ['status', 'owner__name', ...]}` to also allowlist *which field paths*, per model. Unlike REST's `filter_fields` (root-segment match), this checks the **full** `__`-joined path — `'owner'` in the list does not imply `'owner__anything'` is allowed. `filter_by` references tolerate one trailing Django lookup (`owner__name__icontains` matches an allowed `owner__name`) since those reach `Q(**kwargs)` directly; `calc`/`group_by`/`order`/`additional_fields`/`conditions` don't take lookups and are matched literally. Custom fields are the one wildcard: `custom` allows every `custom__<name>`, since they are created at runtime. A model absent from the dict, or the setting left unset, keeps every field of that model open — opt-in, unlike `AGGREGATE_MODELS`. If you already maintain a `bi_fields`/`related_fields` map for a frontend field picker, `easyapi.util.flatten_include_fields(model, bag)` turns that same data into the flat path list this setting expects, so there's one source of truth instead of two.
|
|
@@ -109,6 +109,7 @@ So I cleaned up **easyapi** and put it on GitHub. REST is the core; MCP is an op
|
|
|
109
109
|
|
|
110
110
|
**REST (`BaseResource`)**
|
|
111
111
|
- Async CRUD on Django models with pagination, filters, search, ordering.
|
|
112
|
+
- **`?all=1` lists every row.** No page cut and no `meta`, as `limit=0` does; `page` and `limit` beside it are ignored. `all=0`, `all=false` and an empty value leave paging on. A `Rules` resource stops `all` at the ceiling instead (below).
|
|
112
113
|
- **Strict routes.** An endpoint key is the plain name (`'task'`, `'task/file'`) and matches `task` and `task/...` only, never `tasks` or `task_x`. On it, a path whose tail isn't an id (`/task/undefined`) is a `404` (`easyapi.item_not_found`) on `GET`/`PATCH`/`DELETE`, not the full list. A regex key still works for what a name can't say (`'^logout$'`, `r'^admin/account/\d+/subscription(/.*)?$'`). A loose regex key (`'task(.*)$'`, `'^invoice'`) is refused at startup with `ImproperlyConfigured`, naming the plain key to use.
|
|
113
114
|
- OpenAPI 3.0.3 spec + Scalar UI.
|
|
114
115
|
- Cache with namespace invalidation. Writes don't blow away unrelated rows.
|
|
@@ -488,6 +489,7 @@ Defaults are demo-friendly. Production deployments should:
|
|
|
488
489
|
every route.
|
|
489
490
|
- **`/aggregate` is opt-in.** `get_routes` doesn't mount it unless you pass `aggregate_view=Aggregate` (the generic, unscoped resource — `from easyapi import Aggregate`) or a custom row-scoped subclass. `AGGREGATE_MODELS = ['app_Model', ...]` is mandatory: it lists the models `/aggregate` may query. Without it `get_routes` refuses to boot with `aggregate_view` mounted, and `get_results` answers `403` (`easyapi.aggregate_model_not_allowed`) for every model, with or without `base_queryset` — the body names any model of any installed app, central databases included. References to credential-named columns (in filters, groups, order or calc) are always rejected regardless — the per-resource escape hatch does not reach `/aggregate`. Group values come back as stored (`null`, `""`, `false`, the choice or option value), with the labels of choices (source text) and custom field options in `labels`: `{x, keys}`, or per field with `raw: true`; the text for a null or empty group is up to the UI.
|
|
490
491
|
- **Renamed from `/metrics`.** The endpoint was `/metrics` (`Metrics`, `metrics_view`, `METRICS_*` settings, `easyapi.metrics_*` codes). During the transition `/metrics` answers with the same view as `/aggregate`, `Metrics` and `metrics_view` still work, and each `AGGREGATE_<name>` setting falls back to `METRICS_<name>`; the error codes are already `easyapi.aggregate_*`.
|
|
492
|
+
- **Token scopes apply.** A credential with a scope ceiling (a Bearer token) queries only the models whose `Rules` it may read (`<rules name>:read`, e.g. `contact:read`); a model without `Rules` is refused to it (`403 easyapi.insufficient_scope`), per query in a batch and per series in a `compose`. The screen's session and an API key have no ceiling. A subclass that overrides `resolve` sends each plain query through `query_model(timezone, query)` (the check, then `run_query`).
|
|
491
493
|
- **Batch and stream aggregates.** `POST /aggregate` also takes `{"queries": {"<name>": {...query...}}}` and answers `{"<name>": result}`; a query that fails answers `{"error", "status"}` in its place without failing the others (`403` for a model outside `AGGREGATE_MODELS`, `500` for an unexpected error, logged). With `?stream=1` (or `true`) the batch answers `application/x-ndjson`, one line per query as soon as it is ready (`{"name", "data"}` or `{"name", "error", "status"}`), with `X-Accel-Buffering: no` so nginx does not hold it — a dashboard fills block by block from one request. Queries still run one after another (the ORM is thread-sensitive); the gain is one round trip and early rendering. Bound it: `AGGREGATE_MAX_QUERIES` (default `15`) caps the queries per batch — the rate limiter counts the batch as one request — and a larger batch, or a query that is not an object with `model`, returns `400`. Each failed query counts in the IP's 4xx tripwire like a single failed query; when it trips the batch stops (`403`, or a final blocked line in the stream). To scope rows, override `Aggregate.run_query(timezone, query)` and pass `base_queryset` to `get_results`: it runs every query, single or batched. `Aggregate.resolve(timezone, query)` answers each query and defaults to `run_query`; override it to read the query differently. `dehydrate`/`post_process` apply to the single query only.
|
|
492
494
|
- **Dashboards compose series (optional package).** `from easyapi.dashboards.aggregate import DashboardAggregate` and mount it as `aggregate_view`. A body with `compose: {series: [{name, config}], formula, cumulative, name}` runs each series' `config` as its own aggregate query (through `run_query`, so a scoped subclass scopes every series) and combines them by `x`: up to 4 series (`a`..`d` in the formula), `+ - * /`, parentheses and numbers only, division by zero as `0`, `cumulative` as a running total. All series must be totals or all grouped by one field. Errors are `easyapi.compose_*`.
|
|
493
495
|
- **Bound the aggregate fields, per model.** `AGGREGATE_MODELS` only gates *which models* — every non-credential field on an allowed model is still fair game for `/aggregate` (filter, group, order, calc), including arbitrary FK traversal. Set `AGGREGATE_FIELDS = {'app_Model': ['status', 'owner__name', ...]}` to also allowlist *which field paths*, per model. Unlike REST's `filter_fields` (root-segment match), this checks the **full** `__`-joined path — `'owner'` in the list does not imply `'owner__anything'` is allowed. `filter_by` references tolerate one trailing Django lookup (`owner__name__icontains` matches an allowed `owner__name`) since those reach `Q(**kwargs)` directly; `calc`/`group_by`/`order`/`additional_fields`/`conditions` don't take lookups and are matched literally. Custom fields are the one wildcard: `custom` allows every `custom__<name>`, since they are created at runtime. A model absent from the dict, or the setting left unset, keeps every field of that model open — opt-in, unlike `AGGREGATE_MODELS`. If you already maintain a `bi_fields`/`related_fields` map for a frontend field picker, `easyapi.util.flatten_include_fields(model, bag)` turns that same data into the flat path list this setting expects, so there's one source of truth instead of two.
|
|
@@ -111,7 +111,7 @@ CACHE_TTL_ENABLE = get_setting('CACHE_TTL_ENABLE', default=True)
|
|
|
111
111
|
DEFAULT_AUTHENTICATED = get_setting('DEFAULT_AUTHENTICATED', default=True)
|
|
112
112
|
|
|
113
113
|
_STANDARD_QUERY_PARAMS = frozenset({
|
|
114
|
-
'search', 'fields', 'page', 'limit', 'order_by', 'filter', 'count',
|
|
114
|
+
'search', 'fields', 'page', 'limit', 'all', 'order_by', 'filter', 'count',
|
|
115
115
|
'normalize', 'normalize_list', 'context', 'tags', 'tags_operator',
|
|
116
116
|
'distinct', 'distinct_term', 'distinct_operator',
|
|
117
117
|
})
|
|
@@ -1160,6 +1160,10 @@ class BaseResource(HttpEdge, CoreResource):
|
|
|
1160
1160
|
except Exception:
|
|
1161
1161
|
pass
|
|
1162
1162
|
|
|
1163
|
+
# Same name the Rules reads take; here it keeps ``limit=0``'s meaning (no page cut).
|
|
1164
|
+
if request.GET.get('all') not in (None, '', '0', 'false'):
|
|
1165
|
+
self.limit = 0
|
|
1166
|
+
|
|
1163
1167
|
async def serialize(self, result, **kwargs):
|
|
1164
1168
|
|
|
1165
1169
|
if isinstance(result, HttpResponse):
|
|
@@ -1589,7 +1593,7 @@ class BaseResource(HttpEdge, CoreResource):
|
|
|
1589
1593
|
|
|
1590
1594
|
# List parameters that shape the response page, not which rows match.
|
|
1591
1595
|
_RESOLVE_IGNORED_PARAMS = frozenset({
|
|
1592
|
-
'page', 'limit', 'offset', 'order_by', 'count', 'distinct', 'distinct_term',
|
|
1596
|
+
'page', 'limit', 'all', 'offset', 'order_by', 'count', 'distinct', 'distinct_term',
|
|
1593
1597
|
'distinct_operator', 'fields', 'normalize', 'normalize_list',
|
|
1594
1598
|
})
|
|
1595
1599
|
|
|
@@ -82,7 +82,7 @@ def build_f_expression(on_field):
|
|
|
82
82
|
|
|
83
83
|
USE_TZ = settings.USE_TZ
|
|
84
84
|
|
|
85
|
-
DELTA_REGEX = re.compile(r'^(?P<delta_int>-?\d*)(?P<delta_time>d{1}|m{1}|y{1})$')
|
|
85
|
+
DELTA_REGEX = re.compile(r'^(?P<delta_int>-?\d*)(?P<delta_time>d{1}|w{1}|m{1}|y{1})$')
|
|
86
86
|
|
|
87
87
|
CALC = {
|
|
88
88
|
'avg': Avg,
|
|
@@ -465,6 +465,9 @@ def get_dates(match, timezone):
|
|
|
465
465
|
if delta_time == 'd':
|
|
466
466
|
func = Dates(tz=timezone, remove_tz=remove_tz).day_delta
|
|
467
467
|
|
|
468
|
+
elif delta_time == 'w':
|
|
469
|
+
func = Dates(tz=timezone, remove_tz=remove_tz).week_delta
|
|
470
|
+
|
|
468
471
|
elif delta_time == 'm':
|
|
469
472
|
func = Dates(tz=timezone, remove_tz=remove_tz).month_delta
|
|
470
473
|
|
|
@@ -474,7 +477,7 @@ def get_dates(match, timezone):
|
|
|
474
477
|
return func(delta_int)
|
|
475
478
|
|
|
476
479
|
|
|
477
|
-
_TYPE_SUFFIX = {'day': 'd', 'month': 'm', 'year': 'y'}
|
|
480
|
+
_TYPE_SUFFIX = {'day': 'd', 'week': 'w', 'month': 'm', 'year': 'y'}
|
|
478
481
|
|
|
479
482
|
|
|
480
483
|
def _coerce_delta(value, period_type):
|
|
@@ -4,8 +4,11 @@ import logging
|
|
|
4
4
|
from django.http import JsonResponse, StreamingHttpResponse
|
|
5
5
|
|
|
6
6
|
from .base import BaseResource
|
|
7
|
-
from .calc import get_results
|
|
7
|
+
from .calc import get_model, get_results
|
|
8
8
|
from .exception import HTTPException
|
|
9
|
+
from .rules.authenticator import scopes_of
|
|
10
|
+
from .rules.policy import scope_allows
|
|
11
|
+
from .rules.rules import rules_for
|
|
9
12
|
from .security import track_4xx
|
|
10
13
|
from .serializer import CustomJSONEncoder
|
|
11
14
|
from .settings_helper import get_aggregate_max_queries
|
|
@@ -24,11 +27,17 @@ class Aggregate(BaseResource):
|
|
|
24
27
|
``{"name", "error", "status"}``.
|
|
25
28
|
|
|
26
29
|
``resolve`` answers every query, single or batched; by default it is
|
|
27
|
-
``
|
|
30
|
+
``query_model``. A subclass overrides ``resolve`` to read the query
|
|
28
31
|
differently (``easyapi.dashboards.DashboardAggregate`` combines
|
|
29
|
-
``compose`` series)
|
|
30
|
-
|
|
32
|
+
``compose`` series) and sends each plain query through ``query_model``.
|
|
33
|
+
``run_query`` runs one plain query: override it to scope rows
|
|
34
|
+
(``get_results(..., base_queryset=...)``). ``dehydrate`` and
|
|
31
35
|
``post_process`` apply to the single query only.
|
|
36
|
+
|
|
37
|
+
A credential with a scope ceiling (a Bearer token) reads only the models
|
|
38
|
+
whose ``Rules`` it may read (``<rules name>:read``); a model without
|
|
39
|
+
``Rules`` is refused to it. The screen's session and an API key have no
|
|
40
|
+
ceiling.
|
|
32
41
|
"""
|
|
33
42
|
|
|
34
43
|
allowed_methods = ['post']
|
|
@@ -37,9 +46,25 @@ class Aggregate(BaseResource):
|
|
|
37
46
|
async def run_query(self, timezone, query):
|
|
38
47
|
return await get_results(timezone, query)
|
|
39
48
|
|
|
40
|
-
async def
|
|
49
|
+
async def query_model(self, timezone, query):
|
|
50
|
+
"""One plain query: the scope check, then ``run_query``."""
|
|
51
|
+
self.check_scope(query)
|
|
41
52
|
return await self.run_query(timezone, query)
|
|
42
53
|
|
|
54
|
+
def check_scope(self, query):
|
|
55
|
+
scopes = scopes_of(self.user or {}, self.auth_method)
|
|
56
|
+
if scopes is None:
|
|
57
|
+
return
|
|
58
|
+
name = query.get('model') if isinstance(query, dict) else None
|
|
59
|
+
model = get_model(name) if isinstance(name, str) and '_' in name else None
|
|
60
|
+
rules = rules_for(model) if model else None
|
|
61
|
+
permission = f'{rules.name}:read' if rules else f'{name}:read'
|
|
62
|
+
if rules is None or not scope_allows(scopes, permission):
|
|
63
|
+
raise HTTPException(403, code='easyapi.insufficient_scope', params={'permission': permission})
|
|
64
|
+
|
|
65
|
+
async def resolve(self, timezone, query):
|
|
66
|
+
return await self.query_model(timezone, query)
|
|
67
|
+
|
|
43
68
|
async def post(self, request):
|
|
44
69
|
timezone = self.calc_timezone()
|
|
45
70
|
queries = self.body.get('queries') if isinstance(self.body, dict) else None
|
|
@@ -5,10 +5,11 @@ from .compose import get_composed_results
|
|
|
5
5
|
class DashboardAggregate(Aggregate):
|
|
6
6
|
"""``Aggregate`` that also answers ``compose`` bodies (see ``compose``).
|
|
7
7
|
|
|
8
|
-
Each series runs through ``
|
|
9
|
-
|
|
8
|
+
Each series runs through ``query_model`` (the scope check, then
|
|
9
|
+
``run_query``), so a subclass that scopes rows in ``run_query`` scopes
|
|
10
|
+
every series too."""
|
|
10
11
|
|
|
11
12
|
async def resolve(self, timezone, query):
|
|
12
13
|
if isinstance(query, dict) and query.get('compose'):
|
|
13
|
-
return await get_composed_results(timezone, query['compose'], self.
|
|
14
|
-
return await self.
|
|
14
|
+
return await get_composed_results(timezone, query['compose'], self.query_model)
|
|
15
|
+
return await self.query_model(timezone, query)
|
|
@@ -92,14 +92,19 @@ class Authentication:
|
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
def _scopes(self, user):
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
return scopes_of(user, self.credential)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def scopes_of(user, credential):
|
|
99
|
+
"""The credential's ceiling: a frozenset of scopes, or ``None`` for no ceiling."""
|
|
100
|
+
scopes = user.get('scopes')
|
|
101
|
+
if scopes is None and user.get('mcp_scope') is not None:
|
|
102
|
+
scopes = user['mcp_scope'].split()
|
|
103
|
+
if scopes is not None:
|
|
104
|
+
return frozenset(scopes)
|
|
105
|
+
# A bearer token always has a ceiling: no scopes means none granted.
|
|
106
|
+
# Only the screen's session (and an API key, as today) has no ceiling.
|
|
107
|
+
return frozenset() if credential == 'bearer' else None
|
|
103
108
|
|
|
104
109
|
|
|
105
110
|
def _request_id(request):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easyapi-django
|
|
3
|
-
Version: 1.35.
|
|
3
|
+
Version: 1.35.2
|
|
4
4
|
Summary: Zero-effort REST API (and MCP server) generator from Django models.
|
|
5
5
|
Author-email: Stamatios Stamou Jr <bushier.outsets.0c@icloud.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -164,6 +164,7 @@ So I cleaned up **easyapi** and put it on GitHub. REST is the core; MCP is an op
|
|
|
164
164
|
|
|
165
165
|
**REST (`BaseResource`)**
|
|
166
166
|
- Async CRUD on Django models with pagination, filters, search, ordering.
|
|
167
|
+
- **`?all=1` lists every row.** No page cut and no `meta`, as `limit=0` does; `page` and `limit` beside it are ignored. `all=0`, `all=false` and an empty value leave paging on. A `Rules` resource stops `all` at the ceiling instead (below).
|
|
167
168
|
- **Strict routes.** An endpoint key is the plain name (`'task'`, `'task/file'`) and matches `task` and `task/...` only, never `tasks` or `task_x`. On it, a path whose tail isn't an id (`/task/undefined`) is a `404` (`easyapi.item_not_found`) on `GET`/`PATCH`/`DELETE`, not the full list. A regex key still works for what a name can't say (`'^logout$'`, `r'^admin/account/\d+/subscription(/.*)?$'`). A loose regex key (`'task(.*)$'`, `'^invoice'`) is refused at startup with `ImproperlyConfigured`, naming the plain key to use.
|
|
168
169
|
- OpenAPI 3.0.3 spec + Scalar UI.
|
|
169
170
|
- Cache with namespace invalidation. Writes don't blow away unrelated rows.
|
|
@@ -543,6 +544,7 @@ Defaults are demo-friendly. Production deployments should:
|
|
|
543
544
|
every route.
|
|
544
545
|
- **`/aggregate` is opt-in.** `get_routes` doesn't mount it unless you pass `aggregate_view=Aggregate` (the generic, unscoped resource — `from easyapi import Aggregate`) or a custom row-scoped subclass. `AGGREGATE_MODELS = ['app_Model', ...]` is mandatory: it lists the models `/aggregate` may query. Without it `get_routes` refuses to boot with `aggregate_view` mounted, and `get_results` answers `403` (`easyapi.aggregate_model_not_allowed`) for every model, with or without `base_queryset` — the body names any model of any installed app, central databases included. References to credential-named columns (in filters, groups, order or calc) are always rejected regardless — the per-resource escape hatch does not reach `/aggregate`. Group values come back as stored (`null`, `""`, `false`, the choice or option value), with the labels of choices (source text) and custom field options in `labels`: `{x, keys}`, or per field with `raw: true`; the text for a null or empty group is up to the UI.
|
|
545
546
|
- **Renamed from `/metrics`.** The endpoint was `/metrics` (`Metrics`, `metrics_view`, `METRICS_*` settings, `easyapi.metrics_*` codes). During the transition `/metrics` answers with the same view as `/aggregate`, `Metrics` and `metrics_view` still work, and each `AGGREGATE_<name>` setting falls back to `METRICS_<name>`; the error codes are already `easyapi.aggregate_*`.
|
|
547
|
+
- **Token scopes apply.** A credential with a scope ceiling (a Bearer token) queries only the models whose `Rules` it may read (`<rules name>:read`, e.g. `contact:read`); a model without `Rules` is refused to it (`403 easyapi.insufficient_scope`), per query in a batch and per series in a `compose`. The screen's session and an API key have no ceiling. A subclass that overrides `resolve` sends each plain query through `query_model(timezone, query)` (the check, then `run_query`).
|
|
546
548
|
- **Batch and stream aggregates.** `POST /aggregate` also takes `{"queries": {"<name>": {...query...}}}` and answers `{"<name>": result}`; a query that fails answers `{"error", "status"}` in its place without failing the others (`403` for a model outside `AGGREGATE_MODELS`, `500` for an unexpected error, logged). With `?stream=1` (or `true`) the batch answers `application/x-ndjson`, one line per query as soon as it is ready (`{"name", "data"}` or `{"name", "error", "status"}`), with `X-Accel-Buffering: no` so nginx does not hold it — a dashboard fills block by block from one request. Queries still run one after another (the ORM is thread-sensitive); the gain is one round trip and early rendering. Bound it: `AGGREGATE_MAX_QUERIES` (default `15`) caps the queries per batch — the rate limiter counts the batch as one request — and a larger batch, or a query that is not an object with `model`, returns `400`. Each failed query counts in the IP's 4xx tripwire like a single failed query; when it trips the batch stops (`403`, or a final blocked line in the stream). To scope rows, override `Aggregate.run_query(timezone, query)` and pass `base_queryset` to `get_results`: it runs every query, single or batched. `Aggregate.resolve(timezone, query)` answers each query and defaults to `run_query`; override it to read the query differently. `dehydrate`/`post_process` apply to the single query only.
|
|
547
549
|
- **Dashboards compose series (optional package).** `from easyapi.dashboards.aggregate import DashboardAggregate` and mount it as `aggregate_view`. A body with `compose: {series: [{name, config}], formula, cumulative, name}` runs each series' `config` as its own aggregate query (through `run_query`, so a scoped subclass scopes every series) and combines them by `x`: up to 4 series (`a`..`d` in the formula), `+ - * /`, parentheses and numbers only, division by zero as `0`, `cumulative` as a running total. All series must be totals or all grouped by one field. Errors are `easyapi.compose_*`.
|
|
548
550
|
- **Bound the aggregate fields, per model.** `AGGREGATE_MODELS` only gates *which models* — every non-credential field on an allowed model is still fair game for `/aggregate` (filter, group, order, calc), including arbitrary FK traversal. Set `AGGREGATE_FIELDS = {'app_Model': ['status', 'owner__name', ...]}` to also allowlist *which field paths*, per model. Unlike REST's `filter_fields` (root-segment match), this checks the **full** `__`-joined path — `'owner'` in the list does not imply `'owner__anything'` is allowed. `filter_by` references tolerate one trailing Django lookup (`owner__name__icontains` matches an allowed `owner__name`) since those reach `Q(**kwargs)` directly; `calc`/`group_by`/`order`/`additional_fields`/`conditions` don't take lookups and are matched literally. Custom fields are the one wildcard: `custom` allows every `custom__<name>`, since they are created at runtime. A model absent from the dict, or the setting left unset, keeps every field of that model open — opt-in, unlike `AGGREGATE_MODELS`. If you already maintain a `bi_fields`/`related_fields` map for a frontend field picker, `easyapi.util.flatten_include_fields(model, bag)` turns that same data into the flat path list this setting expects, so there's one source of truth instead of two.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/account_access/migrations/__init__.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
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/management/commands/__init__.py
RENAMED
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/billing/management/commands/billing.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
|
|
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
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/module/resources.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/router/endpoints.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/gen/templates/settings/settings.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/labels/management/commands/__init__.py
RENAMED
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/labels/management/commands/export_labels.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
|
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/es_ES/LC_MESSAGES/django.mo
RENAMED
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/es_ES/LC_MESSAGES/django.po
RENAMED
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/pt_BR/LC_MESSAGES/django.mo
RENAMED
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/locale/pt_BR/LC_MESSAGES/django.po
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
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/resources/device_authorization.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
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/templates/easyapi_oauth/consent.html
RENAMED
|
File without changes
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi/oauth/templates/easyapi_oauth/device.html
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
|
|
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
|
{easyapi_django-1.35.0 → easyapi_django-1.35.2}/easyapi_django.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|