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
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/a69b467c-fe66-45ab-9623-9b9d8aee609dn%40googlegroups.com.