#2264: Documentation Error in ToscaWidgets Tutorial
---------------------------+------------------------------------------------
 Reporter:  pedersen       |       Owner:        
     Type:  documentation  |      Status:  new   
 Priority:  normal         |   Milestone:  2.0rc1
Component:  Documentation  |     Version:  2.0b7 
 Severity:  normal         |    Keywords:        
---------------------------+------------------------------------------------
 At this location:
 http://www.turbogears.org/2.0/docs/main/ToscaWidgets/forms.html#introduction

 The model columns are described as follows:
 {{{
     id = Column(Integer, primary_key=True)
     title = Column(String(100), nullable=False)
     description = Column(Text, nullable=True)
     year = Column(Integer, nullable=True)
     genre = Column(String(100), nullable=True)
     release_date = Column(Date, nullable=True)
 }}}

 However, every use of {{{genre}}} is store an integer. This results in an
 inability to properly build the update form, as the SelectSingleField will
 be using an integer, while the options are using a string that happens to
 be a number. As a result, the "selected" option will never be present in
 the drop down that gets displayed to the user, which means that any
 selection done will appear to never take place.

 The fix is simple: Define genre as follows:
 {{{
     genre = Column(Integer, nullable=True)
 }}}

 After that, update becomes easy again, and things work as expected.

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2264>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to