I have a simple table (simplified more here) that has a date field:
db.define_table('QuarterMaster',
Field('IssueYr', 'integer',
widget = lambda f, v: SQLFORM.widgets.integer.widget(f, v, _autofocus=True)),
Field('PostDate', "date", requires=IS_DATE(format='%Y-%m-%d', error_message='must be YYYY-MM-DD!')))
The app I'm tweaking uses SQLITE3 as the DB, so under the blankets, the date is a string, but perhaps the blankets keep me from overriding the widget with this:
form = SQLFORM(db.QuarterMaster, fields = ['PostDate'])
db.QuarterMaster.PostDate.widget = SQLFORM.widgets.autocomplete(
request, db.QuarterMaster.PostDate, id_field = db.QuarterMaster.id,
min_length = 4, orderby = ~db.QuarterMaster.PostDate)
Am I out of luck, or just missing a little percursive maintenance to make the autocomplete fit?
/dps