using the famous mywiki as my testbed i could do with a little more
direction
with implementing the new custom sqlforms:
in model:
db.define_table('page',
SQLField('timestamp','datetime',default=now),
SQLField('title'),
SQLField('body','text'))
in controller:
def edit():
"edit for for existing wiki page"
try: thispage=db(db.page.id==request.args[0]).select()[0]
except: redirect(URL(r=request,f='index'))
myform=SQLFORM(db.page,thispage,deletable=False,fields=['body'])
if myform.accepts(request.vars,session):
session.flash='page saved'
redirect(URL(r=request,f='show',args=request.args))
elif myform.errors: response.flash='page not saved'
return dict(form=myform)
in view:
??
I only want to show the body as a textarea to use nicedit with it then
I plan
to save back to db using {{=XML(record.body,sanitize=True)}} format.
thanks
chrism
On Feb 16, 1:27 pm, mdipierro <[email protected]> wrote:
> Thank you Denes.
>
> Massimo
>
> On Feb 15, 11:27 pm, DenesL <[email protected]> wrote:
>
> > Starting with rev.726 SQLFORM provides new attributes useful to build
> > custom forms without the need to re-access the DB.
>
> > For more information please read Alter Ego entry
> > 205:https://mdp.cti.depaul.edu/AlterEgo/default/show/205
>
> > Comments welcome.
> > DenesL.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---