create-caspian-app 0.2.0-beta.77 → 0.2.0-beta.78
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.
- package/dist/main.py +7 -2
- package/package.json +1 -1
package/dist/main.py
CHANGED
|
@@ -387,6 +387,8 @@ def register_single_route(url_pattern: str, file_path: str):
|
|
|
387
387
|
req_should_cache = None
|
|
388
388
|
req_cache_ttl = 0
|
|
389
389
|
|
|
390
|
+
page_content_source = file_path
|
|
391
|
+
|
|
390
392
|
if file_path.endswith('.py'):
|
|
391
393
|
module = load_route_module(file_path)
|
|
392
394
|
if not hasattr(module, 'page'):
|
|
@@ -429,11 +431,14 @@ def register_single_route(url_pattern: str, file_path: str):
|
|
|
429
431
|
req_cache_ttl = cache_settings.ttl
|
|
430
432
|
|
|
431
433
|
if isinstance(result, tuple):
|
|
432
|
-
|
|
434
|
+
page_content = result[0]
|
|
435
|
+
content = str(page_content)
|
|
436
|
+
page_content_source = getattr(page_content, 'source_path', file_path)
|
|
433
437
|
if len(result) >= 2 and isinstance(result[1], dict):
|
|
434
438
|
page_layout_props = result[1]
|
|
435
439
|
else:
|
|
436
440
|
content = str(result)
|
|
441
|
+
page_content_source = getattr(result, 'source_path', file_path)
|
|
437
442
|
|
|
438
443
|
dynamic_meta = _runtime_metadata.get()
|
|
439
444
|
static_meta = getattr(module, 'metadata', None)
|
|
@@ -464,7 +469,7 @@ def register_single_route(url_pattern: str, file_path: str):
|
|
|
464
469
|
page_metadata=page_metadata,
|
|
465
470
|
page_layout_props=page_layout_props,
|
|
466
471
|
context_data=full_context,
|
|
467
|
-
page_component_source=
|
|
472
|
+
page_component_source=page_content_source,
|
|
468
473
|
control_mode=True,
|
|
469
474
|
component_compiler=transform_components
|
|
470
475
|
)
|