Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #730 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

FastData ignores SQLObject title on Boolean columns

Reported by: tlesher@… Owned by: icc
Priority: normal Milestone:
Component: FastData Version: 0.9a3
Severity: normal Keywords: fastdata


FastData? data controllers pay attention to the "title" attribute of SQLObjects in the list view for all column types, but not in the form view for BoolCol? columns.


  1. Quickstart a project
  2. Create a model with:
    class MenuItem(SQLObject):
        name = StringCol(length=32, title="Item Name")
        has_spam = BoolCol(title="Has Spam in It")
  3. Create a controller:
    import cherrypy
    import turbogears
    from turbogears import controllers, expose, redirect
    from turbogears import identity
    import tgfastdata
    import model
    class Root(tgfastdata.DataController):
  4. Run tg-admin sql create
  5. Start the app and view  http://localhost:8080
  6. Notice that all headers use the title attribute.
  7. Add a record. Notice the 'has_spam' field label.

This appears to work for all column types but BoolCol?.

Change History

comment:1 Changed 13 years ago by tlesher@…

  • Component changed from TurboGears to FastData

comment:2 Changed 13 years ago by icc

  • Owner changed from anonymous to icc

The fix for this is very easy. If someone could tell me the appropriate patch style, and how to submit it, I would appreciate it. I just got turned onto turbogears by my friend Brian Beck, and am hoping to help fix bugs. Please email me, icc at case dot edu - many thanks!

The fix is as follows:

in formmaker.py, the column_boolean function is as such:

def column_boolean(column):

return widgets.CheckBox?(column.name)

column_boolean = column_widget.when("isinstance(column, col.SOBoolCol)")(column_boolean)

so it's no surprise that no other parameters are being seen by CheckBox?(). the fix is obvious, looking at the other functions in this module:

def column_boolean(column):

parms = column_parms(column) return widgets.CheckBox?(parms)

column_boolean = column_widget.when("isinstance(column, col.SOBoolCol)")(column_boolean)

comment:3 Changed 13 years ago by elvelind

  • Status changed from new to closed
  • Resolution set to fixed


Note: See TracTickets for help on using tickets.