well, how do like that! It worked! I thought next=URL(r=request) would be the default behavior.
thx, -wes On Wed, Nov 18, 2009 at 12:31 PM, mr.freeze <[email protected]> wrote: > > It's kind of redundant but you need to tell crud.update to redirect > back to itself using 'next': > > form=crud.update(db.student,student[0],next=URL(r=request)) > > > On Nov 18, 11:27 am, Wes James <[email protected]> wrote: >> pulled latest trunk >> >> put this in db.py >> >> db.define_table("student", >> SQLField("last_name","string",length=30,default=auth.user.last_name >> if auth.is_logged_in() else '',requires=[IS_NOT_EMPTY()]), >> SQLField("first_name","string",length=30,default=auth.user.first_name >> if auth.is_logged_in() else '',requires=[IS_NOT_EMPTY()]), >> SQLField("middle_name","string",length=30,default=""), >> >> SQLField("preferred_name","string",length=30,default="",requires=[IS_NOT_EMPTY()]) >> ) >> >> put this in default.py >> >> def profile(): >> student=db(db.student.id==1).select(db.student.ALL) >> if (student): >> form=crud.update(db.student,student[0]) >> else: >> form=crud.create(db.student) >> if form.errors: >> response.flash="There was an error submitting the form! >> Please check for any errors below the fields." >> return dict(form=form,response=response) >> >> I created default/profile.html >> >> {{extend 'layout.html'}} >> {{=form}} >> >> first time form comes up blank - fine - put some data in press enter >> - the form is blank - refresh screen, the data is there, including >> delete checkbox. >> >> Shouldn't this bring up the form with the data filled in after a >> submit/update/insert? >> >> -wes > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

