Ah, thanks so much, that worked like a charm!! Good to know I can pass
in a tuple to Venusian - I missed that while stepping through the
debugger earlier. And thank you for the references.

On Sat, 13 Sept 2025 at 13:27, Michael Merickel <[email protected]> wrote:
>
> You don't show the @panel_config but assuming it's within the boundaries of 
> one of your calls to config.scan() then the issue is that pyramid's "scan" 
> function by default scans for "pyramid" decorators and pyramid_layout 
> registers its decorators under the "pyramid_layout" category. This means you 
> should adjust your scan for panels to include that category:
>
>     config.scan("myapp.panels", categories=("pyramid", "pyramid_layout"))
>
> See 
> https://github.com/Pylons/pyramid_layout/blob/202a291bbb947e7f5c43c5216878331987508f05/pyramid_layout/panel.py#L36
>  and 
> https://docs.pylonsproject.org/projects/pyramid/en/latest/api/config.html#pyramid.config.Configurator.scan.
>
>
> On Sep 13, 2025, at 10:56, 'Antony Owino' via pylons-discuss 
> <[email protected]> wrote:
>
> Hello,
>
> Struggling get to panels executed, i.e. Pyramid renders None instead of panel 
> content. I have the following code in myapp/__init__.py
>
> @event_source
> def configure_panels(config):
> config.include("pyramid_layout")
>
> @event_source
> def configure_views(config):
> ...
>
> # adds cornice
> config.include("cornice")
>
> # adds panels
> config.include("pyramid_layout")
> from . import panels
> config.include("myapp.panels.dashboard")
> config.scan(panels)
>
> from . import views
> config.scan(views)
>
>
> def main(global_config, **settings):
> """This function returns a Pyramid WSGI application."""
> with Configurator(settings=settings) as config:
> # Core view and layout related
> ...
> configure_views(config)
> configure_panels(config)
> ...
>
> Which is supposed to load views and panels but the panels are not executed.
>
> What works is manually adding a panel in myapp/panels/dashboard/__init__.py 
> i.e.:
>
> def includeme(config):
> """Configure dashboard panels."""
> config.include("pyramid_layout")
>
> # !!! This does not work
> # I have an empty __init__.py in the panels/dashboard module
> config.scan("myapp.panels.dashboard")
>
> # Manual panel addition (only this works)
> config.add_panel(
> "myapp.panels.dashboard.dashboard.test_panel",
> name="test_panel",
> renderer="string",
> )
>
> I'd really prefer adding the panels declaratively. Thank you all in advance.
>
> __ntny__
>
> --
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/pylons-discuss/e1327a42-0360-4182-9b6c-aed2ee6b7139n%40googlegroups.com.
>
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "pylons-discuss" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/pylons-discuss/JyKmAF_xNak/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/pylons-discuss/E3F504D3-54EF-4F4B-B754-B6AA609B44CC%40gmail.com.



-- 
__ntony__

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/pylons-discuss/CANHVrfcsei6t4XRN26YC%2BF9adqACGGDEvH9w69TZHJ%3DK_t9C0A%40mail.gmail.com.

Reply via email to