Sunday, June 27, 2010

Re: Rendering the Admin app list?

On Jun 26, 6:14 pm, "euan.godd...@googlemail.com"
<euan.godd...@gmail.com> wrote:
> There is no reason why all views should pass that variable to the
> template. It is more efficient to only pass the minimal variable
> necessary to render the template Even the list is lazily evaluated
> there is still unnecessary overhead in passing it when not needed.
>
> Euan
>
> On 26 June, 08:50, derek <gamesb...@gmail.com> wrote:
>
>
>
> > On Jun 25, 8:45 pm, raj <rajeeshrn...@gmail.com> wrote:
>
> > > > Before I "pass the variable app_list"; do I not need to create what is
> > > > in this variable first?  If so, how?
>
> > > That template is rendered by the view, AdminSite.index() found at
> > > django.contrib.admin.sites. Please Check it to know how it's done.
>
> > > Rajeesh.
>
> > Will do.  I just find it very strange that, given I am working
> > in_and_with the Admin app, this routine works *only* in the index
> > page...
>

Thanks. That makes sense.

For the record, I have found this snippet:
http://djangosnippets.org/snippets/1921/
which generates the apps and models in a form usable in a template.
The models are not sorted but seems like a minor issue.

Derek

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