Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to handle multiple views in one page
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Arndt Droullier  
View profile  
 More options Nov 8 2012, 6:55 am
From: Arndt Droullier <ar...@dvelectric.de>
Date: Thu, 8 Nov 2012 12:55:53 +0100
Local: Thurs, Nov 8 2012 6:55 am
Subject: Re: How to handle multiple views in one page

Pyramid provides several options to call views or templates from inside
your application code.
They make quite easy to reuse templates and views.
See "pyramid.renderers" for template rendering or "pyramid.view" for views.

e.g.
    from pyramid.view import render_view

    ...
    return render_view(context, request, view_name, secure)

invokes the view including template lookup, security and so on.

Or

    from pyramid.renderers import render

    ...
    html = render("one_template.pt", {}, request=request)

gives you control over the template to be rendered.

Arndt.

2012/11/7 Marten <lehm...@cnm.de>

> Hello,

> I searched a lot through documentation and examples, but I couldn't find
> any best practise on how to tie together a bunch of views to one page.

> You'll surely know dashbords that contain dozends of containers like load
> graphs, contact details, latest tasks in history, pending transactions of
> whatever ... Each container on its own is a usual view that renders fine on
> its own, but there has to be some master page, that includes all these
> views. And it would be crazy to prepare all data in one view and feed a
> mega-template.

> As similar problem arised during my development, when handling non-static
> headers like menu tree and user profile ("Hello <name>!" or "Login"). I
> know how to define a template so it loads a surrounding master template,
> but I don't know how to tell feed that with data. I also know how to bind a subscriber
> to a new request, but that would be processed before the view is called.
> And especially regarding a login view it depends on whether the login
> attempt was successful or not which "Hello <name>!" or "Login" has to be
> rendered in the surrounding template. I think the views itself shouldn't
> know anything about menus and user details. Access permissions can be
> defined by roles on views.

> What is the best practise to do such things? Can you refer to any public
> source code on git (was well as a working website running this code so I
> see if it does what I mean) or examples in documentation? Thanks.

> Kind regards
> Marten

> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-discuss/-/0quNBRga8dMJ.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.

--
DV Electric / Arndt Droullier / Nive cms cms.nive.co

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.