Hi,
when i said:

db.artykuly.textareafield.represent

I want to say that "textareafield" was your field in the definition of
your db.

Like:

db.define_table('artykuly',
Field('yourtextareafield', 'text')....

I said that because i didn't know how your field is named :)

Anyway, mr.freeze has sent a better solution than mine :)

Regards
Daniel

El lun, 29-11-2010 a las 04:02 -0800, Emceha escribió:
> Thanks Daniel for hint.
> 
> Unfortunately it looks like db object doesn't have textareafield
> attribute:
> 
> google_appengine/web2py/gluon/sql.py", line 1703, in __getattr__
>     return dict.__getitem__(self,key)
> KeyError: 'textareafield'
> 
> That's what I'm getting now :(
> 
> On Nov 29, 11:43 am, Daniel Gonzalez <[email protected]> wrote:
> > I dont know if this could work for you:
> >
> > def dodaj_artykul():
> >    db.artykuly.textareafield.represent = lambda k: TEXTAREA(value=k,
> > _cols=100, _rows=100)
> >    form=crud.create(db.artykuly,next='pokaz_artykul/[id]')
> >    return dict(form=form)
> >
> > I don't know how this could affect the functionlity of the form, because 
> > the name of the textarea can change. You can try with passing another 
> > attribute to the TEXTAREA helper: (_name="some_name")
> >
> > But I don't know if web2py will search later for that name to process the 
> > form, you can search in the source code of the processed form to see what 
> > name gives web2py to the field, and use it.
> >
> > I hope that this is what are you looking for.
> >
> > El lun, 29-11-2010 a las 02:27 -0800, Emceha escribió:
> >
> >
> >
> >
> >
> >
> >
> > > Thanks Daniel for prompt reply,
> >
> > > I've read chapter 7 already, also did some google search - but I was
> > > wondering if there is easier way to do it - (with less code and maybe
> > > just passing some parameters on crud.create as it's not really
> > > customization I want to do - I would call it more like forms settings)
> >
> > > Marcin
> >
> > > On Nov 29, 11:17 am, Daniel Gonzalez <[email protected]> wrote:
> > > > Hi,
> >
> > > > Checkout the chapter 7 of the book, specially this 
> > > > part:http://web2py.com/book/default/chapter/07#Custom-forms
> >
> > > > Regards
> > > > Daniel
> >
> > > > El lun, 29-11-2010 a las 02:11 -0800, Emceha escribió:
> >
> > > > > Here is my controller code:
> >
> > > > > def dodaj_artykul():
> > > > >     form=crud.create(db.artykuly,next='pokaz_artykul/[id]')
> > > > >     return dict(form=form)
> >
> > > > > I see that textarea always has cols=40 and rows=10 - I wanted to
> > > > > change that value but I haven't found any straight forward example to
> > > > > do it using CRUD only?
> >
> > > > > Should I use SQLFORM?
> >
> > > > > Thanks


Reply via email to