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 #1034 (closed defect: wontfix)

Opened 13 years ago

Last modified 10 years ago

FastData computing column defaults too early

Reported by: icc Owned by: anonymous
Priority: normal Milestone:
Component: FastData Version: 0.9a5
Severity: normal Keywords:


In SQLObject, a column default can be a simple value or a callable, which is obscured by the _get_default() method of SQLObject's Column Class. If 'default' is a callable, we shouldn't be calling it until we're ready to display the form. Currently we aren't doing this. Right now DataController calls formmaker.fields_for on initialization, and fields_for gets around to calling column_parms, which sets the default for the widget equal to the default for the column. This is bad! Those of us who have default=datetime.now in our model want the form to come up with TODAYS date as the default, not the date when turbogears was started up!

I think we want to set the defaults each time one of the controllers is called... so maybe add a new method to DataController called "_updateWidgetDefaults" that would look through self.sqlclass.sqlmeta.columns and update the fields in self.form_widget with the default values? Does that sound like a good approach?

Change History

comment:1 Changed 13 years ago by jorge.vargas

  • Milestone set to __future__

comment:2 Changed 10 years ago by jorge.vargas

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

FastData? is unmaintained, please use sprox.org.

2009 ticket cleanup

comment:3 Changed 10 years ago by anonymous

  • Milestone __future__ deleted

Milestone future deleted

Note: See TracTickets for help on using tickets.