Re: Including view in a template

2007-08-02 Thread Kyle Fox
You might want to try writing an inclusion tag: http://www.djangoproject.com/documentation/templates_python/#inclusion-tags They are much simpler to write than template tags, and more "designer friendly." They let you write a separate template that gets rendered inside of another template

Re: Including view in a template

2007-08-01 Thread James Bennett
On 8/1/07, sagi s <[EMAIL PROTECTED]> wrote: > Not clear on what you mean by "more robust views". Can you please > elaborate? Write views which select more data. > Regarding custom template tags, I guess I expect many users to want to > use django this way, so I think that having a "load_view"

Re: Including view in a template

2007-08-01 Thread [EMAIL PROTECTED]
Another option is to use AJAX to populate the "building block" areas. e.g. (Using JQuery) $(document).ready(function() { $('#block1').load('/views/list_users'); $('#block2').load('/views/latest_articles'); }); ... ... -Eric Florenzano On Aug 1, 11:34 am, sagi s <[EMAIL

Re: Including view in a template

2007-08-01 Thread sagi s
Not clear on what you mean by "more robust views". Can you please elaborate? Regarding the term "views", I do mean actually invoking the python function via the url routing system. I would settle for calling a regular python function that returns some html snippet but I think the existing views

Re: Including view in a template

2007-08-01 Thread James Bennett
On 8/1/07, sagi s <[EMAIL PROTECTED]> wrote: > I realize that this is an option but it seems to me more natural to > control the content from the template so a designer can build views > using "lego-blocks", without having to tweak the view. You either want: 1. More robust views, or 2. Some

Re: Including view in a template

2007-08-01 Thread sagi s
Thanks for the quick reply! I realize that this is an option but it seems to me more natural to control the content from the template so a designer can build views using "lego-blocks", without having to tweak the view. Cheers, Sagi On Aug 1, 10:01 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>

Re: Including view in a template

2007-08-01 Thread [EMAIL PROTECTED]
In the view.py code that you have calling your frontpage_template.html, you should put your code to query the database and generate your user list and articles. You would then pass these to your html template via: return render_to_response('frontpage_template.html',

Including view in a template

2007-08-01 Thread sagi s
I am trying to find a way to include a view in a template. The view generates an html snippet based on a DB query + another template. In pseudocode what I am trying to achieve is: frontpage_template.html: {{% include header.html %}} {{% load /views/list_users %}} {{% load /views/latest_articles