Thank you

It works !!!! (yes i can ;-) )

On 4 nov, 22:57, mdipierro <[EMAIL PROTECTED]> wrote:
> db.news.tags.widget=t2.tag_widget(db.news.tags,['news'])
>
> should be
>
> db.news.tags.widget=lambda a,b:t2.tag_widget(a,b,['news'])
>
> A widget is a function that takes a field and its value.
>
> On Nov 4, 3:50 pm, JessiHash <[EMAIL PROTECTED]> wrote:
>
> > Hello and thank you for this wonderful piece of software
>
> > I' trying to use T2 and i have a problem with the tag_widget.
>
> > here is my code :
>
> > db.define_table('news',
> >         SQLField('title', required=True),
> >         SQLField('slug', default=''),
> >     SQLField('date', 'date', default=datetime.date.today()),
> >     SQLField('link'),
> >         SQLField('text', 'text'),
> >     SQLField('tags'),
> >     SQLField('picture','upload'),
> >     SQLField('created_by_ip'),
> >     SQLField('created_on','datetime'),
> >     SQLField('created_signature'),
> >     SQLField('modified_by_ip'),
> >     SQLField('modified_on','datetime'),
> >     SQLField('modified_signature')
> >         )
>
> > db.news.slug.requires=SLUG()
> > db.news.link.requires=IS_URL()
> > db.news.tags.widget=t2.tag_widget(db.news.tags,['news'])
> > db.news.represent=lambda row: A(row.title+" posted on
> > "+str(row.date),_href=t2.action('display_news', [row.id]))
>
> > display_new is just a t2.create with a t2.itemize
>
> > And i got this :
>
> > Traceback (most recent call last):
> >   File "/home/jessihash/Bureau/web2py/gluon/restricted.py", line 62,
> > in restricted
> >     exec ccode in environment
> >   File "/home/jessihash/Bureau/web2py/applications/bhi37/controllers/
> > siteadmin.py", line 52, in <module>
> >   File "/home/jessihash/Bureau/web2py/gluon/globals.py", line 55, in
> > <lambda>
> >     self._caller=lambda f: f()
> >   File "/home/jessihash/Bureau/web2py/applications/plugin_t2/modules/
> > t2.py", line 855, in h
> >     return f(*a,**b)
> >   File "/home/jessihash/Bureau/web2py/applications/bhi37/controllers/
> > siteadmin.py", line 38, in create_news
> >     create=t2.create(db.news)
> >   File "/home/jessihash/Bureau/web2py/applications/plugin_t2/modules/
> > t2.py", line 373, in create
> >     showid=False,col3=col3,_class='t2-create')
> >   File "/home/jessihash/Bureau/web2py/gluon/sqlhtml.py", line 89, in
> > __init__
> >     inp=field.widget(field,default)
> > TypeError: 'DIV' object is not callable
>
> > with T2.display i don't have any error.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to