Re: login_required for imported apps

2008-10-23 Thread Heather
> Authentication is actually handled by a middleware, you know ?-) Heh, well, this is true so I guess it's not such a big deal, then. > Ok, I already expressed MVHO on this, which is that having a clean way > to apply a same decorator to a whole set of urls at once would be a > good thing. Now a

Re: login_required for imported apps

2008-10-23 Thread bruno desthuilliers
On 22 oct, 23:46, Heather <[EMAIL PROTECTED]> wrote: > That was a really good post - thanks :) I know you don't *have* to > use anything from the app you include or even *have* to include > everything in an app you write. But I think that I just have this > idea in my head that I can't let go of

Re: login_required for imported apps

2008-10-22 Thread Heather
That was a really good post - thanks :) I know you don't *have* to use anything from the app you include or even *have* to include everything in an app you write. But I think that I just have this idea in my head that I can't let go of that each part should be able to be inherited from - not jus

Re: login_required for imported apps

2008-10-21 Thread bruno desthuilliers
On 21 oct, 16:40, Heather <[EMAIL PROTECTED]> wrote: > I completely agree. Even the middleware solution doesn't seem quite > right as it will check each page/request. Well, that's the whole concept of middlewares, isn't it ?-) > I've been thinking about > this a lot and I wonder if maybe the on

Re: login_required for imported apps

2008-10-21 Thread Heather
I completely agree. Even the middleware solution doesn't seem quite right as it will check each page/request. I've been thinking about this a lot and I wonder if maybe the only part that should be reusable is the models? I don't know. But since there is no way (that I know of) to use inheritan

Re: login_required for imported apps

2008-10-21 Thread bruno desthuilliers
On 20 oct, 01:33, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sun, Oct 19, 2008 at 2:10 PM, bruno desthuilliers > > <[EMAIL PROTECTED]> wrote: > > Indeed. But , OTHO, having to copy/paste a whole urls.py just to a add > > a simple decorator on the view functions is not really DRY. > > Person

Re: login_required for imported apps

2008-10-19 Thread James Bennett
On Sun, Oct 19, 2008 at 2:10 PM, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > Indeed. But , OTHO, having to copy/paste a whole urls.py just to a add > a simple decorator on the view functions is not really DRY. Personally, I don't agree; writing code to do what you want, even if it starts wit

Re: login_required for imported apps

2008-10-19 Thread bruno desthuilliers
On 18 oct, 18:12, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sat, Oct 18, 2008 at 10:22 AM, Heather <[EMAIL PROTECTED]> wrote: > > Well, after trying to work this out a bit more, it looks like a nice > > solution is to make a middleware class and use the process_views() but > > I'm not quite

Re: login_required for imported apps

2008-10-18 Thread Heather
Are you saying, instead of saying r^'some_pattern/', include(urls_to_include), basically cut and paste that included url file into my project's url file then decorate the views (in this case, they are all generic)? While I understand you can write any urls you want, I guess I don't understand why

Re: login_required for imported apps

2008-10-18 Thread James Bennett
On Sat, Oct 18, 2008 at 12:25 PM, Heather <[EMAIL PROTECTED]> wrote: > What do you mean by "set up the urls so you'll have it"? Somewhere in your URL configuration, put URL patterns which point to the views you want at the URLs you want, and wrap the views with login_required there. Remember: UR

Re: login_required for imported apps

2008-10-18 Thread Heather
What do you mean by "set up the urls so you'll have it"? On Oct 18, 12:12 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sat, Oct 18, 2008 at 10:22 AM, Heather <[EMAIL PROTECTED]> wrote: > > Well, after trying to work this out a bit more, it looks like a nice > > solution is to make a midd

Re: login_required for imported apps

2008-10-18 Thread James Bennett
On Sat, Oct 18, 2008 at 10:22 AM, Heather <[EMAIL PROTECTED]> wrote: > Well, after trying to work this out a bit more, it looks like a nice > solution is to make a middleware class and use the process_views() but > I'm not quite at the answer yet. Generally, I don't consider the URLs for an appli

Re: login_required for imported apps

2008-10-18 Thread Heather
Well, after trying to work this out a bit more, it looks like a nice solution is to make a middleware class and use the process_views() but I'm not quite at the answer yet. On Oct 17, 11:15 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 17 oct, 16:18, Heather <[EMAIL PROTECTED]> wrote:

Re: login_required for imported apps

2008-10-17 Thread Heather
Considering the point is to be able to build reusable apps, I have to agree that there must be a clean way and I am guessing we are not the only ones who've found a need for this ;) I need to read over this a bit more to really get it. I just read about callback functions so it's kind of a new c

Re: login_required for imported apps

2008-10-17 Thread bruno desthuilliers
On 17 oct, 16:18, Heather <[EMAIL PROTECTED]> wrote: > I have a couple of projects that use the same application > (particularly, photologue). In one project, I want the views of the > imported application to require users be signed in. All the views in > this imported application are generic.

login_required for imported apps

2008-10-17 Thread Heather
I have a couple of projects that use the same application (particularly, photologue). In one project, I want the views of the imported application to require users be signed in. All the views in this imported application are generic. So, is it possible to use login_required w/o having to go int