Re: Views returning data only

2008-07-20 Thread Yuri Baburov
Hi Victor, http://www.djangosnippets.org/snippets/821/ ? On Tue, Jul 15, 2008 at 5:36 PM, vicvicvic <[EMAIL PROTECTED]> wrote: > > In the Django FAQ, we can read this about views: > >>In our interpretation of MVC, the "view" describes the data that gets >>presented to the user. It's not

Re: Views returning data only

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 9:10 AM, vicvicvic <[EMAIL PROTECTED]> wrote: > On Jul 15, 3:13 pm, Arien <[EMAIL PROTECTED]> wrote: >> On Tue, Jul 15, 2008 at 7:34 AM, vicvicvic <[EMAIL PROTECTED]> wrote: >> > On Jul 15, 1:57 pm, Arien <[EMAIL PROTECTED]> wrote: >> >> On Tue, Jul 15, 2008 at 5:36 AM,

Re: Views returning data only

2008-07-15 Thread vicvicvic
On Jul 15, 3:13 pm, Arien <[EMAIL PROTECTED]> wrote: > On Tue, Jul 15, 2008 at 7:34 AM, vicvicvic <[EMAIL PROTECTED]> wrote: > > On Jul 15, 1:57 pm, Arien <[EMAIL PROTECTED]> wrote: > >> On Tue, Jul 15, 2008 at 5:36 AM, vicvicvic <[EMAIL PROTECTED]> wrote: > > >> If a view picks a template and

Re: Views returning data only

2008-07-15 Thread vicvicvic
On Jul 15, 3:20 pm, "Waylan Limberg" <[EMAIL PROTECTED]> wrote: > Vicvicvic, > > I think your on to something here. However, we need to remember that > one of the great things about Django views is that they are just > python functions. You can do pretty much anything you want. So, if > someone

Re: Views returning data only

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 8:20 AM, Waylan Limberg <[EMAIL PROTECTED]> wrote: > I think your on to something here. However, we need to remember that > one of the great things about Django views is that they are just > python functions. ... or any other callable. Arien

Re: Views returning data only

2008-07-15 Thread vicvicvic
On Jul 15, 3:05 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Hi Victor, > > It sounds like your pattern works well for you, which is good. > > Another pattern that can be used is to have the view select off of some of > the request attributes, and maybe even add your own test functions (such

Re: Views returning data only

2008-07-15 Thread Waylan Limberg
Vicvicvic, I think your on to something here. However, we need to remember that one of the great things about Django views is that they are just python functions. You can do pretty much anything you want. So, if someone wants to build up a complete html page in python code without any templates,

Re: Views returning data only

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 5:51 AM, vicvicvic <[EMAIL PROTECTED]> wrote: > An interesting effect of this whole thing is that it decouples views > from not only formatting but protocol. Django is a *Web* framework. Views are the part of the framework that generate responses to requests and both of

Re: Views returning data only

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 5:36 AM, vicvicvic <[EMAIL PROTECTED]> wrote: > > In the Django FAQ, we can read this about views: > >> In our interpretation of MVC, the "view" describes the data that gets >> presented to the user. It's not necessarily how the data looks, but which >> data is

Re: Views returning data only

2008-07-15 Thread vicvicvic
Maybe I should mention: Since only specially decorated views act this way, the change is completely backwards-compatible. At its current state, it does restrict how you use "internal" and "format" as capturing patterns in URLs, obviously. Also, the format-decorator checks if the view returns a

Views returning data only

2008-07-15 Thread vicvicvic
In the Django FAQ, we can read this about views: >In our interpretation of MVC, the “view” describes the data that gets >presented to the user. It’s not necessarily how the data looks, but which data >is presented. The view describes which data you see, not how you see it. It’s >a subtle