that's honestly what it comes down to in this case. An app isn't some
sacred walled city. Just write a template tag, import whatever you
need from whichever apps they belong to, and stick it on the page.
But before you do that, read the following:
http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/#howto-custom-template-tags
On Jul 26, 12:00 pm, owidjaya <owidj...@gmail.com> wrote:
> how do i write custom template tag that is available to all my apps.
> not tied to a particular app?
>
> On Jul 26, 7:05 am, bruno desthuilliers
>
>
>
> <bruno.desthuilli...@gmail.com> wrote:
> > On 25 juil, 00:25, owidjaya <owidj...@gmail.com> wrote:
>
> > > if i have a page with sections say the home page. It has section for
> > > news, it has section for blog, comments and etc.
> > > I have apps for every one of those section. Now how do i add the
> > > output of the view for each of those apps on the same page?
>
> > You don't. A Django "view" is just a callable that takes an HTTP
> > request and returns an HTTP response. The solution to your problem is
> > to write custom templatetags for news, blog, comments etc and call
> > these templatetags from the templates that needs them.
>
> > HTH
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment