Thank you , guys ~
Your help are really good for me ~
On Dec 1, 11:23 pm, Jon Loyens <[EMAIL PROTECTED]> wrote:
> Another +1 for decorators. In fact, the example David S uses
> authentication and logins as an example of what he wants to do and its
> already handled as a decorator thus giving him
Another +1 for decorators. In fact, the example David S uses
authentication and logins as an example of what he wants to do and its
already handled as a decorator thus giving him a decent pattern to
follow. David S, I'd suggest you look up the @login_required
decorator and even look through the
David,
+1 for decorator.
That let you use it or not in each view.
On Dec 1, 9:30 am, David Shieh <[EMAIL PROTECTED]> wrote:
> Thanks , David Zhou , I will find some information for decorator
> And also , I will surf for middleware .
>
> Thank you very much , Malcolm.
>
> On Dec 1, 3:55 pm, "Dav
Thanks , David Zhou , I will find some information for decorator
And also , I will surf for middleware .
Thank you very much , Malcolm.
On Dec 1, 3:55 pm, "David Zhou" <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 1, 2008 at 2:23 AM, David Shieh <[EMAIL PROTECTED]> wrote:
> > I dont' know whether thi
On Mon, Dec 1, 2008 at 2:23 AM, David Shieh <[EMAIL PROTECTED]> wrote:
> I dont' know whether this make any sense .
> Right now , I can't test it , but if django won't initiate the
> views.py as a class , this method will make no sense.
Why not write a decorator?
---
David Zhou
[EMAIL PROTECTED
I have found a post in here :
http://davyd.livejournal.com/262859.html
this is the way this author resolves this problem.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, s
No , not in that way.
Let me show you some code
#a.py
class A:
def __init__(self):
#do somthing
#views.py
class B(A):
def index(request):
#do something else
#urls.py
(r'^$', 'site.app.views.index'),
I dont' know whether this make any sense .
Right now , I can't tes
On Sun, 2008-11-30 at 22:46 -0800, David Shieh wrote:
> yeah , I will consider about middleware , and I am also thinking about
> write a class that contains the functions I need , and other funcions
> just inherit it , will it work ?
Since functions don't inherit from classes, your question does
yeah , I will consider about middleware , and I am also thinking about
write a class that contains the functions I need , and other funcions
just inherit it , will it work ?
On Dec 1, 2:41 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2008-11-30 at 22:35 -0800, David Shieh wrote:
>
On Sun, 2008-11-30 at 22:35 -0800, David Shieh wrote:
> Hi , Malcolm,
>
> Now , I understand what you said.But using session means user must to
> call a certain to set the session.
I was using session as an *example*. It's something that, based on
incoming request information, is run every time
Hi , Malcolm,
Now , I understand what you said.But using session means user must to
call a certain to set the session.I mean , for example , I am setting
up a blog , and every page want to show the categories this blog
have . If I write these categories as a session value , I have to
write it int
On Sun, 2008-11-30 at 21:48 -0800, David Shieh wrote:
> Thanks , Malcolm ,
>
> I think your solution can resolve my problem.But does it a bit
> complex ?
> In fact , what I really want is a view function that will be called by
> every view function.
> i.e. , if I wrote an auth system , I need to
On Sun, Nov 30, 2008 at 11:48 PM, David Shieh <[EMAIL PROTECTED]> wrote:
> I think your solution can resolve my problem.But does it a bit
> complex ?
> In fact , what I really want is a view function that will be called by
> every view function.
> i.e. , if I wrote an auth system , I need to authe
Thanks , Malcolm ,
I think your solution can resolve my problem.But does it a bit
complex ?
In fact , what I really want is a view function that will be called by
every view function.
i.e. , if I wrote an auth system , I need to authenticate whether the
user is logged in every view functions and
On Sun, 2008-11-30 at 19:41 -0800, David Shieh wrote:
[...]
> I have searched for some information . I know that middleware can do
> this , but what I really want is just a small function for this .
A process_request() function in middleware can be as small as you like.
Middleware provides the h
I have used Django for several months , and it really attacts me . I
love it.
But when I use it more , I found a problem troubles me , that is , I
can't find a way to make a function be called by every view function
automatically .
I used CakePHP , it have a function named beforeFilter() . It wil
16 matches
Mail list logo