hi all
when I use repoze.who and what in tg2 by default , I found that
the permissions and groups are queried through database every time
include visiting the css file ,
this is the log:
===================================
2010-05-10 23:22:40,533 -- repoze.who request started (/) --
2010-05-10 23:22:40,533 request classification: browser
2010-05-10 23:22:40,533 identifier plugins registered
[<FriendlyFormPlugin 32828496>, <AuthTktCookiePlugin 32828560>]
2010-05-10 23:22:40,533 identifier plugins matched for classification
"browser": [<FriendlyFormPlugin 32828496>, <AuthTktCookiePlugin
32828560>]
2010-05-10 23:22:40,533 no identity returned from <FriendlyFormPlugin
32828496> (None)
2010-05-10 23:22:40,533 identity returned from <AuthTktCookiePlugin
32828560>: {'tokens': [''], 'timestamp': 1273504954,
'repoze.who.userid': u'wangchao', 'userdata': 'userid_type:unicode'}
2010-05-10 23:22:40,533 identities found: [(<AuthTktCookiePlugin
32828560>, {'tokens': [''], 'timestamp': 1273504954,
'repoze.who.userid': u'wangchao', 'userdata': 'userid_type:unicode'})]
2010-05-10 23:22:40,534 authenticator plugins registered
[<bjnozpw.lib.auth.MySQLAlchemyAuthenticatorPlugin object at
0x1f4eb10>]
2010-05-10 23:22:40,534 authenticator plugins matched for
classification "browser":
[<bjnozpw.lib.auth.MySQLAlchemyAuthenticatorPlugin object at
0x1f4eb10>]
2010-05-10 23:22:40,534 userid preauthenticated by
<AuthTktCookiePlugin 32828560>: "wangchao" (repoze.who.userid set)
...
...
LIMIT 0, 2) AS anon_1 LEFT OUTER JOIN tg_user_group AS
tg_user_group_1 ON anon_1.tg_user_user_id = tg_user_group_1.user_id
LEFT OUTER JOIN tg_group AS tg_group_1 ON tg_group_1.group_id =
tg_user_group_1.group_id
23:22:40,540 INFO [sqlalchemy.engine.base.Engine.0x...e4d0]
['wangchao']
2010-05-10 23:22:40,542 User belongs to the following groups: ()
2010-05-10 23:22:40,542 User has the following permissions: ()
2010-05-10 23:22:40,562 no challenge required
2010-05-10 23:22:40,562 -- repoze.who request ended (/) --
2010-05-10 23:22:40,939 -- repoze.who request started (/css/
pagination.css) --
2010-05-10 23:22:40,939 request classification: browser
2010-05-10 23:22:40,940 identifier plugins registered
[<FriendlyFormPlugin 32828496>, <AuthTktCookiePlugin 32828560>]
2010-05-10 23:22:40,940 identifier plugins matched for classification
"browser": [<FriendlyFormPlugin 32828496>, <AuthTktCookiePlugin
32828560>]
2010-05-10 23:22:40,940 no identity returned from <FriendlyFormPlugin
32828496> (None)
2010-05-10 23:22:40,940 identity returned from <AuthTktCookiePlugin
32828560>: {'tokens': [''], 'timestamp': 1273504954,
'repoze.who.userid': u'wangchao', 'userdata': 'userid_type:unicode'}
2010-05-10 23:22:40,940 identities found: [(<AuthTktCookiePlugin
32828560>, {'tokens': [''], 'timestamp': 1273504954,
'repoze.who.userid': u'wangchao', 'userdata': 'userid_type:unicode'})]
...
...
23:22:40,947 INFO [sqlalchemy.engine.base.Engine.0x...e4d0]
['wangchao']
2010-05-10 23:22:40,949 User belongs to the following groups: ()
2010-05-10 23:22:40,949 User has the following permissions: ()
2010-05-10 23:22:40,966 no challenge required
2010-05-10 23:22:40,966 -- repoze.who request ended (/css/
pagination.css) --
===================================
so I think that is not good for my application, I want to save the
permissions and grous in the session scope.
or use memcached to cache it , but I don't know how
thanks in advance
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.