web2py v2.0.1-11 Release Notes

  • DAL Improvements

    • Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda table:), thanks Jonathan
    • db(...).select(cacheable=True) make select 30% faster
    • ๐Ÿ“œ db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x faster
    • ๐Ÿ‘ db(...).count(cache=(cache.ram,3600)) now supported
    • ๐Ÿ‘ MongoDB support in DAL (experimental), thanks Mark Breedveld
    • geodal and spatialite, thanks Denes and Fran (experimental)
    • db.mytable._before_insert, _after_insert, _before_update, _after_update, _before_delete. _after_delete (list of callbacks)
    • โšก๏ธ db(...).update_naive(...) same as update but ignores table._before_update and table._after_update
    • ๐Ÿ‘ DAL BIGINT support and DAL(...,bigint_id=True)
    • IS_IN_DB(..., distinct=True)
    • ๐Ÿ†• new syntax: db.mytable.insert(myuploadfield=open(....)), thank you Iceberg
    • db(...).select(db.mytable.myfield.count(distinct=True))
    • โšก๏ธ db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id))
    • db.mytable.myfield.filter_in, filter_out
    • db.mytable._enable_record_versioning(db) adds versioning to this table
    • teradata adapter, thanks Andrew Willimott
    • experimental Sybase Adapter
    • โž• added db.table.field.avg()
    • ๐Ÿ‘Œ Support for Google App Engine projections, thanks Christian
    • 0๏ธโƒฃ Field(... 'upload', default=path) now accepts a path to a local file as default value, if user does not upload a file. Relative path looks inside current application folder, thanks Marin
    • ๐Ÿ“œ executesql(...,fields=,columns=) allows parsing of results in Rows, thanks Anthony
    • Rows.find(lambda row: bool(), limitby=(0,1))

    Auth improvements

    • auth.enable_record_versioning(db) adds full versioning to all tables
    • @auth.requires_login(otherwise=URL(...))
    • ๐Ÿ‘ auth supports salt and compatible with third party data, thanks Dave Stoll
    • 0๏ธโƒฃ CRYPT now defaults to pbkdf2(1000,20,sha1)
    • Built-in wiki with menu, tags, search, media, permissions. def index: return auth.wiki()
    • auth.settings.everybody_group_id
    • ๐Ÿ‘ allow storage of uploads on any PyFileSystem (including amazon)

    Form improvements

    • FORM.confirm('Are you sure?',{'Back':URL(...)})
    • SQLFORM.smartdictform(dict)
    • form.add_button(value,link)
    • SQLFORM.grid(groupby='...')
    • ๐Ÿ›  fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
    • more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, csv, ...)

    Admin improvements

    • new admin pages: manage_students, bulk_regsiter, and progress reports
    • ๐Ÿ”’ increased security in admin against CSRF
    • experimental Git integration
    • ๐Ÿš€ experimental OpenShift deployment
    • multi-language pluralization engine
    • ๐ŸŒ ace text web editor in admin
    • ๐ŸŒ Ukrainian translations, thanks Vladyslav Kozlovskyy
    • ๐ŸŒ Romanian translation for welcome, thanks ionel
    • ๐Ÿ‘Œ support for mercurial 2.6, thanks Vlad

    โฑ Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim)

    • โฑ web2py.py -K myapp -X starts the myapp scheduler alongside the webserver
    • tasks are marked EXPIRED (if stop_time passed)
    • โฑ functions with no result don't end up in scheduler_run
    • more options: web2py.py -E -b -L
    • โฑ scheduler can now handle 10k tasks with 20 concurrent workers and with no issues
    • ๐Ÿ†• new params: tasks can be found in the environment (no need to define the tasks parameter) max_empty_runs kills the workers automatically if no new tasks are found in queue (nice for "spikes" of processing power) discard_results to completely discard the results (if you don't need the output of the task) utc_time enables datetime calculations with UTC time
    • โฑ scheduler_task changes: task_name is no longer required (filled automatically with function_name if found empty) uuid makes easy to coordinate scheduler_task maintenance (filled automatically if not provided) stop_time has no default (previously was today+1) retry_failed to requeue automatically failed tasks sync_output refreshes automatically the output (nice to report percentages)
    • ๐Ÿ‘ท workers can be: DISABLED (put to sleep and do nothing if not sending the heartbeat every 30 seconds) TERMINATE (complete the current task and then die) KILL (kill ASAP)

    Other Improvements

    • โœ… gluon/contrib/webclient.py makes it easy to create functional tests for app
    • DIV(..).elements(...replace=...), thanks Anthony
    • ๐Ÿ†• new layout based on Twitter Bootstrap
    • ๐Ÿ†• New generic views: generic.ics (Mac Mail Calendar) and generic.map (Google Maps)
    • 0๏ธโƒฃ request.args(0,default=0, cast=int, otherwise=URL(...)), thanks Anthony
    • redirect(...,type='auto') will be handled properly in ajax responses
    • routes in can redirect outside with routes_in=[('/path','303->http://..')]
    • ๐Ÿ‘ better memcache support
    • ๐Ÿ‘Œ improved spreadsheet, thanks Alan
    • ๐Ÿ†• new internationalization engine, thanks Vladyslav
    • pluralization engine, thanks Vladyslav
    • ๐Ÿ†• new markmin with support for nested lists, , , autolinks, thanks Vladyslav
    • ๐Ÿ†• new syntax: {{=BR()*5}}
    • gluon.cache.lazy_cache decorator allows caching functions in modules
    • ๐Ÿ‘ .coffee and .less support in response.files, thanks Sam Sheftel
    • ๐Ÿ‘ ldap certificate support
    • ๐Ÿ‘ pg8000 postgresql driver support (experimental)
    • @cache('%(name)s%(args)s%(vars)s',5) and cache.autokey
    • โž• added tox.ini, thanks Marc
    • web2py.py --run_system_tests, thanks Marc Abramowitz
    • html.py (and web2py helpers) can be used without web2py dependencies
    • ๐Ÿ†• new fpdf, thanks Mariano