Re: Multiple types of output (HTML, JS), same view.

2008-11-18 Thread bruno desthuilliers
On 18 nov, 21:29, "David Zhou" <[EMAIL PROTECTED]> wrote: > On Thu, Oct 30, 2008 at 4:08 PM, bruno desthuilliers > > <[EMAIL PROTECTED]> wrote: > > rendering, based on request informations. The points I'm yet really > > happy with are: > > - how to tell the rendering decorator what we want to

Re: Multiple types of output (HTML, JS), same view.

2008-11-18 Thread David Zhou
On Thu, Oct 30, 2008 at 4:08 PM, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > rendering, based on request informations. The points I'm yet really > happy with are: > - how to tell the rendering decorator what we want to render > - how to avoid template duplication for 'full' rendering and

Re: Multiple types of output (HTML, JS), same view.

2008-11-18 Thread Joe Murphy
Hi Bruno, Your solution is more elegant and more DRY than the approach I took. This is what I ended up with: # urls.py (r'^election/results/(?P[-\w]+)/(?P\d{4})/((? P(js|htm))\/)?$', 'race.views.racename_detail'), # views.py def get_filetype(filetype): if filetype: return filetype

Re: Multiple types of output (HTML, JS), same view.

2008-10-30 Thread bruno desthuilliers
On 30 oct, 20:22, Joe Murphy <[EMAIL PROTECTED]> wrote: > Hi, > > So I've got a bunch of views that I need to output in three forms: > HTML with the site wrapper (header, footer etc.), HTML without the > site wrapper, and JS. The templates are really, really similar. > > I'm thinking of using a

Multiple types of output (HTML, JS), same view.

2008-10-30 Thread Joe Murphy
Hi, So I've got a bunch of views that I need to output in three forms: HTML with the site wrapper (header, footer etc.), HTML without the site wrapper, and JS. The templates are really, really similar. I'm thinking of using a url pattern like: r'^blog/blah(?P[-\.\/\w]+)$' so that blog/blah/