It seemed a good idea to break up a large controller file into two.  Now I 
have default.py and full.py.
User() is in full.py.  So, now my views are broken because auth won't work 
to create the auth links in the navbar.

The default views reference auth as:  <div id="navbar">{{='auth' in 
globals() and auth.navbar(separators=(' ',' | ',''))}}</div>

I followed the suggestion to create my own auth.navbar as follows:  

def user():
    return dict(form = auth())


def user_bar():
    action = 'full/user'
    if auth.user:
        logout = A('logout', URL(action + '/logout'))
        profile = A('profile', URL(action + '/profile'))
        password = A('change password', URL(action + '/change_password'))
        bar = SPAN(auth.user.email, ' | ', profile, ' | ', password, ' | ', 
logout, _class = 'auth_navbar')
    else:
        login = A('login', URL(action + '/login'))
        register = A('register', _href = action + '/register')
        lost_password = A('lost password', URL(action + 
'/request_reset_password'))
        bar = SPAN(' ', login, ' | ', register, ' | ', lost_password, 
_class = 'auth_navbar')
    return bar

So, in my views I need something like:

<div id="navbar">{{=user_bar()}}</div>

But, this produces the error:  
<type 'exceptions.NameError'> name 'user_bar' is not defined

I am really lost here, guys.  I don't understand what I am supposed to do 
if the action isnot in default.py (which I don't want to do for other 
reasons....).

-- 



Reply via email to