Thursday, June 28, 2012

Re: Avoiding code repetition in views

On Fri, 2012-06-29 at 01:07 +0200, Christophe Pettus wrote:
> > I hope i have been clear
>
> I'm going to take a guess and surmise that you have a lot of different
> view functions, each one of which needs to pass a list of gigs into
> the context for the template and then render that page, and you're
> trying to avoid repeating the code that builds the list of gigs. Is
> that correct?
>
> You might look at whether you really need all those separate view
> functions, or if they can be rolled together. You might also look at
> using class-based Views in 1.4 as a way to factor out the
> gig-list-building code in a reasonable way.

or use templatetags
--
regards
Kenneth Gonsalves

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