Re: Global model/view best practice help

2007-04-11 Thread Dave
Thanks Sam, that was enough for me to start playing around with. Perfect. :) On Apr 11, 3:44 pm, "Sam" <[EMAIL PROTECTED]> wrote: > Like Todd said, > > 1. Write a function : > > def my_template_vars(request) > return {'var1': 'test', 'var2': 'test2'} > > 2. Edit your settings.py >

Re: Global model/view best practice help

2007-04-11 Thread Sam
Like Todd said, 1. Write a function : def my_template_vars(request) return {'var1': 'test', 'var2': 'test2'} 2. Edit your settings.py TEMPLATE_CONTEXT_PROCESSORS = ( ... 'project.app.file.my_template_vars', ) 3. Inside your views, load your templates with a RequestContext object

Re: Global model/view best practice help

2007-04-11 Thread Dave
Hi all, I was looking at middleware - so, thanks Todd for the pointer in the right direction. I can't seem to find anything much in docs or on the web about TEMPLATE_CONTEXT_PROCESSORS in Django. Anyone got any links? Cheers, Dave On Apr 10, 11:47 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote:

Re: Global model/view best practice help

2007-04-10 Thread Todd O'Bryan
On Tue, 2007-04-10 at 22:21 +, Dave wrote: > I could add to the Context object in each view, but that's a lot of > repeat code (urgh). Also, if I were to take that route, I'd need the > Model to be available between multiple apps within a project and I've > not seen how to do that. You want

Global model/view best practice help

2007-04-10 Thread Dave
Hi all, (firstly, sorry for the subject, couldn't think how to summarize this well) I'm wondering what the best practice is for what I'm looking to do. All thoughts and pointers to where in Django in much appreciated: I want a model that I can use directly in the template. The data needs to