Re: Application design question

2009-02-01 Thread eddie

Thanks Alex, that was exactly what I was looking for.

On Jan 31, 8:06 pm, "alex.gay...@gmail.com" 
wrote:
> On Jan 31, 8:04 pm, eddie  wrote:
>
>
>
> > Hey guys & girls,
>
> > I've just started playing with django, and am not sure of the best way
> > to do something.
>
> > I've got a basic site, where page a displays model a, page b displays
> > model b, etc.  Every model has it's own view function and template,
> > all extending a base template with a header, footer, etc.  In every
> > page's footer, I would like to add a parsed RSS feed (just an ul of
> > links).
>
> > I don't want to repeat code, so I don't feel like calculating it and
> > sending it to every render_to_response that I've got (I'll worry about
> > caching later, by the way).  So I wonder if there is a way that I
> > could give every template access to this object without adding it to
> > my views... though this seems like a kind of "global variable" type
> > situation that I'm a little wary of too.
>
> > How would you proceed?
>
> > Thanks!
> > -e
>
> Take a look at implementing a template context processor.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Application design question

2009-01-31 Thread alex.gay...@gmail.com



On Jan 31, 8:04 pm, eddie  wrote:
> Hey guys & girls,
>
> I've just started playing with django, and am not sure of the best way
> to do something.
>
> I've got a basic site, where page a displays model a, page b displays
> model b, etc.  Every model has it's own view function and template,
> all extending a base template with a header, footer, etc.  In every
> page's footer, I would like to add a parsed RSS feed (just an ul of
> links).
>
> I don't want to repeat code, so I don't feel like calculating it and
> sending it to every render_to_response that I've got (I'll worry about
> caching later, by the way).  So I wonder if there is a way that I
> could give every template access to this object without adding it to
> my views... though this seems like a kind of "global variable" type
> situation that I'm a little wary of too.
>
> How would you proceed?
>
> Thanks!
> -e

Take a look at implementing a template context processor.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Application design question

2009-01-31 Thread eddie

Hey guys & girls,

I've just started playing with django, and am not sure of the best way
to do something.

I've got a basic site, where page a displays model a, page b displays
model b, etc.  Every model has it's own view function and template,
all extending a base template with a header, footer, etc.  In every
page's footer, I would like to add a parsed RSS feed (just an ul of
links).

I don't want to repeat code, so I don't feel like calculating it and
sending it to every render_to_response that I've got (I'll worry about
caching later, by the way).  So I wonder if there is a way that I
could give every template access to this object without adding it to
my views... though this seems like a kind of "global variable" type
situation that I'm a little wary of too.

How would you proceed?

Thanks!
-e
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---