Uliweb Changelog

What's new in Uliweb 0.2.5

Feb 17, 2014
  • Fix config template and add uwsgi shell support
  • Add environment variables support in settings.ini. For example, there is a MYSQL_PORT defined in environment, so you can defined something in settings.ini:
  • [DEFAULT]
  • port = $MYSQL_PORT
  • port_str = '${MYSQL_PORT}'
  • $MYSQL_PORT is the same as ${MYSQL_PORT}. Just when the variable follows identifier, so ${} can easily separate between them.
  • Add STATIC_COMBINE_CONFIG configuration, you can toggle static combination with it. Default is False. The configuration is:
  • [STATIC_COMBINE_CONFIG]
  • enabled = False
  • Fix objcache app bug, if not fields defined in settings, it'll use all columns of table
  • Add get_table function to functions, you can use it to get table object. Used in uliweb.contrib.tables app.
  • Add local_cache to local in SimpleFrame, and it can be used to store require relative cache values, and it'll be empty after each require process.
  • Improve get_object() function in ORM, add use_local parameter, so the cached value will be checked in local_cache first, and also save it in local_cache when get a value from cache or database.
  • Improve objcache config format, you can also define table like this:
  • user = {'fields':['username'], 'expire':expire_time, 'key':callable(instance)|key_field}
  • #or
  • user = ['username', 'nickname']
  • #or
  • user =
  • If no fields defined, it'll use all fields of Model. And if expire is 0 or not defined, it'll not expired at all.
  • key will be used to replace id, if you want another key value, and it can be also a callable object, it'll receive an instance of Model parameter, so you can create any key value as you want.
  • Add Optimistic Concurrency Control support for ORM, so you should defined version Field first in Model, then when you save the object, you should use:
  • obj.save(occ=True)
  • If there is already other operation saved the record, it'll raise an SaveError Exception by default, because the version has been changed. You can also pass:
  • occ_fieldname used to defined the version fieldname, default is version
  • occ_exception used to enabled Exception raised, default is True, if you set it False it'll return False, but not raise an Exception.

New in Uliweb 0.2.4 (Jan 13, 2014)

  • Fix ORM is not compatible with SQLAlchemy 0.9.1. Old style:
  • cond = None
  • cond = (Blog.c.id==5) & None
  • will not right in 0.9.1, because None will not be skipped, so you can change above code cond = None to:
  • from sqlalchemy.sql import true
  • cond = true()
  • from uliweb.orm import true
  • cond = true()
  • add __contains__ to functions, so you can test if an API is already defined, just use:
  • 'flash' in functions
  • Refact generic.py, remove functions.flash and functions.get_fileserving dependencies by default.
  • Fix yield support in view function, you can also used in gevent environment, for example:
  • @expose('/test')
  • def test():
  • yield ""
  • for i in range(10):
  • yield "%d" % (i + 1)
  • sleep(1)
  • yield ""
  • Fix rawsql() bug for different database engine
  • Fix jsonp() dumps Chinese characters bug
  • Add trim_path() function to utils/common.py, it can trim a file path to limited length, for example:
  • >>> a = '/project/apps/default/settings.ini'
  • >>> trim_path(a, 30)
  • '.../apps/default/settings.ini'
  • Default limited length is 30.
  • Add ORM connection information output when given -v option in command line. And the password will be replace with '*'. For example:
  • $>uliweb syncdb -v
  • Connection : mysql://blog:***@localhost/blog?charset=utf8
  • [default] Creating [1/1, blog] blog...EXISTED
  • Add multiple apps support for makeapp command, so you can use :
  • uliweb makeapp a b c
  • to create a, b, c apps at once time.
  • Refactor save_file() process, add headers and convertors parameter.
  • headers used to create csv header instead of using column name, but you can create alias name like this:
  • User.c.username.label(u"Name")
  • and convertors used to convert column value, for example:
  • def name(value, data):
  • """
  • value is the column value
  • data is the current record object
  • """
  • return value + 'test'
  • save_file(do_(select([User.c.name])), 'test.csv', convertors={'name':name})
  • Fix call_view() invoke wrap_result bug. Missing pass handler parameter to wrap_result.