On 9/19/06, trond <[EMAIL PROTECTED]> wrote:
>
> I first read about Django 3 days ago. Now I try to make myself a blog.
>
> I want to show data from different apps and sql-tables on the same
> page. My frontpage should show a blog, my friends birthdays and qoutes.
> With Generic-views I have made a simple blog, but on the same page, I
> want to show my friends birthdays. I have read tutorials on making
> different things, but how can I put the data together? In the view or
> in the template?
>
> Can I use generic views to fetch in example three different list of
> objects at the same time, sending this to the template? Or is it
> possible to put together templates containing data like this
> psaudo-code:
>
> <body>
> <div>include blog/ </div>
> <div>include friends/</div>
> <div>include qoutes/<div>
> </body>
>
> Sorry for my stupid english.


Your English is fine!

What you want is template tags,
http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags

and template inheritance.

That way, you could do something like this in a base template:

<div> {% block content %}{% endblock %} </div>
<div> {% friends_birthdays %} </div>
<div> {% quotes %} </div>

and in some inherited template (say, specific to your blog), you could do:

{% block content %}
Blog stuff here
{% endblock %}

For some examples, you can look at the source code of awwca.ca, found
at: http://svn.jayparlar.com/website/trunk/awwca/

Here, I have a templates/base.html which defines the base template. I
also have templatetags created in articles/templatetags and
events/templatetags

Jay P.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to