Anthony, No conversation is no column in the entiy table but I expect the field to be processed like the example in the book:
form = SQLFORM(db.yourtable) my_extra_element = TR(LABEL('I agree to the terms and conditions'), INPUT(_name='agree',value=True,_type='checkbox')) form[0].insert(-1,my_extra_element) Do INPUT and SELECT behave differently? Richard D On Saturday, January 31, 2015 at 6:46:40 AM UTC+1, Anthony wrote: > > You added a select element with the name "conversation" to a SQLFORM based > on db.entity. Does db.entity include a field named "conversation"? > > On Friday, January 30, 2015 at 9:12:44 AM UTC-5, Richard D wrote: >> >> According the book I have added a field to a SQLFORM using the following >> code: >> >> form_chg_entity = SQLFORM(db.entity, showid=False, record = >> session.sif.id, deletable = False, fields= form_fields ) >> option_conversations = [OPTION(conv.subject, _value=conv.id) for >> conv in db((db.conversation.entity==session.sif.id) >> >> &(db.conversation.community==session.com.id) >> >> ).select()] >> option_conversations.insert(0, OPTION("", _value=0)) >> justify_entity = TR(LABEL('Change based on'), >> SELECT(_name='conversation', >> *option_conversations)) >> >> form_chg_entity[0].insert(-1, justify_entity) >> >> However >> >> if form_chg_entity.process(formname='change_entity').accepted: >> .... >> >> Gives an error : >> <type 'exceptions.AttributeError'> 'Table' object has no attribute >> 'conversation' >> What is going wrong? >> >> Richard D >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.