On 18 nov, 21:29, "David Zhou" <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 30, 2008 at 4:08 PM, bruno desthuilliers
>
> <[EMAIL PROTECTED]> wrote:
> > rendering, based on request informations. The points I'm yet really
> > happy with are:
> > - how to tell the rendering decorator what we want to render
> > - how to avoid template duplication for 'full' rendering and 'partial'
> > rendering
>
> > wrt/ first point, the simplest solution IMHO is to pass a render=json
> > or render=partial argument in the query string (default being
> > rendering the 'full' page). My main problem is with second point. I
> > have a working scheme using two templates, the 'full' one doing an
> > include of the 'partial' one. This should work, but I still don't like
> > having two distinct templates.
>
> I'd need to check Django's template code to see if this is possible,
> but one possibility is to give the decoration a "block" parameter, to
> render a specific block from a template.  So you could have something
> like:
>
> @render_view('js', 'template.html', block='js_block')
> def view:
>    pass

I've been investigating and doing a bit more work on this point since
then, and indeed there are ways to only render a given block from a
template. I have nothing worth being posted so far (too much to do on
other, more fundamental features for our current project), but we
should soon come to the point where we'll have to make this work. I'll
post back then with possibly improved solutions.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to