Puppy app, noob

1 view
Skip to first unread message

ed

unread,
Nov 13, 2008, 3:52:38 AM11/13/08
to web2py Web Framework
Hi,
The default display of Puppy app is the login display. How can i
change the default display without changing "login" function. I would
like to display some text below the menu ("LOGIN" "REGISTER") once the
app is loaded and display the login screen only after "LOGIN" is
clicked in the menu bar. I've checked the source in the controllers
and view and also in the plugin t2 but did not find any or was too
complex for me. Thanks

mdipierro

unread,
Nov 13, 2008, 7:39:16 AM11/13/08
to web2py Web Framework
change this:

def login(): return dict(login=t2.login())
@t2.requires_login(next='login')
def index():
return dict(search=t2.search
(db.t2_person,db.puppy,query=friendship),
form=t2.create(db.puppy,onaccept=lambda
form:t2.add_access(db.puppy,form.vars.id) and db.friendship.insert
(person_id=t2.person_id,puppy_id=form.vars.id)))

into

def index():
if t2.logged_in: t2.redirect('private_index')
return dict()
def login(): return dict(login=t2.login())
@t2.requires_login(next='login')
def private_index():
return dict(search=t2.search
(db.t2_person,db.puppy,query=friendship),
form=t2.create(db.puppy,onaccept=lambda
form:t2.add_access(db.puppy,form.vars.id) and db.friendship.insert
(person_id=t2.person_id,puppy_id=form.vars.id)))

Massimo
Reply all
Reply to author
Forward
0 new messages