authenticate decorator

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

authenticate decorator

Otto Bretz-3
Hello,

I need some help with $topic. I can't figure it out.

I have the following code in my class:

def auth(self, username, password):
        if username == 'jane' and password == 'doe':
            return True

        return False

@authenticate(auth)
def getAdminTagsList(self):
        tags = []
        result = t['tags'].select().execute()
        for row in result:
            tag = models.AdminTag()
            tag.id = row['id']
            tags.append(tag)

        return tags

But when I try to run this I get: TypeError: authenticate() takes at
least 2 arguments (1 given). But how can I add the decorated method as
the first parameter to authenticate? Am I misunderstanding this?

thanks,
Otto
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Loading...