Hi all,
I want to update user information and currently active
controller to html template page(pylons c object). Because of this i
can display user "name" or "signin and register" content to html
template, also i want to update requested current controller to
template to highlight the page. My code is,
class BaseController(WSGIController):
main_panel = ""
..............
..............
def __after__(self, **kargs):
environ = kargs['environ']
if environ.get("REMOTE_USER"):
c.user_loggedin = True
c.user_name = environ["REMOTE_USER"]
c.main_panel = self.main_panel
class ShoppingController(BaseController):
def __init__(self):
BaseController.main_panel = "Shopping"
.............
.............
class SportsController(BaseController):
def __init__(self):
BaseController.main_panel = "Sports"
.............
.............
And my Template code follows,
% if c.user_loggedin:
<li "first">welcome ${c.user_name}</li>
% else:
<li "first"><a href="/account/signin">Signin</a></li>
<li><a href="/account/new">Register</a></li>
% endif
% if c.main_panel == "Shopping":
<b>Shopping</b>
% else:
<a href="/shopping">Shopping</a>
% endif
% if c.main_panel == "Sports":
<b>Sports</b>
% else:
<a href="/sports">Sports</a>
% endif
c.user_loggedin is working fine. But c.main_panel is always empty
string only. Even I am setting main_panel my derived Controllers.
Thanks,
Santhosh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---