One important thing we forgot to mention.
TG 0.9a5 ships with FE 0.5.1 that fixes some long standing issue with
how not_empty works inside validators, basically this means that now
*every* validator has not_empty=False by default, this was the case
even before but now this is respected hence if you were using a
validator like Int() and not providing not_empty to mark it as required
you should now take care of doing this.
Example:
>>> from turbogears import validators
>>> int = validators.Int()
>>> int.not_empty
False
>>> int.to_python('')
>>> int.not_empty = True
>>> int.not_empty
True
>>> int.to_python('')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/home/michele/Progetti/TurboGears/svn/1.0/thirdparty/formencode/formencode/api.py",
line 305, in to_python
raise Invalid(self.message('empty', state), value, state)
formencode.api.Invalid: Please enter a value
>>>
While before 0.9a5 using Int() and to_python('') will have raised a
"Please enter an integer value" exception.
Another handy feature related to this is that now it's pretty easy to
tweak some defaults parameter for such form fields that are already
providing a validator, for example if you use any SelectionField
(SingleSelectField, MultipleSelectField, CheckBoxList, RadioButtonList)
the validator is automatically guessed and not required by default, if
you want to mark the field as required without passing a whole new
validator you can pass a dict as validator in this way:
widgets.MultipleSelectField(..., validator=dict(not_empty=True))
Ciao
Michele
Kevin Dangoor wrote:
> Just in time for today's documentation sprint, and packed with more
> goodies than originally planned, TurboGears 0.9a5 ("incredible") is
> out!
>
> As of now, there are no docs for the new features, but we'll start
> correcting that at 10AM Eastern today (join us at #turbogears on
> freenode if you dare!).
>
> Several people put in quite a bit of effort this week to make this
> release possible (many of the folks in the Contributors section below
> were quite active on the trunk list this week). The plan is for this
> to be the last 0.9 alpha release, so we pulled out the stops to get
> the last upheavals done.
>
>
> 0.9a5 (April 26, 2006)
> ----------------------
>
> *Backwards Incompatibilties*
>
> * An identity login form must have a submit button having the name
> specified in the config file (identity.form.submit). If you have a
> commented identity.form.submit value and used the default login.kid
> file, you will need to add 'name="login"' to the login.kid submit
> button.
> * In widgets, the base Widget class no longer supports a validator.
> If you need a validator you should use the InputWidget class
> * In widgets, the display and the adjust_value methods have a slightly
> different signature (if you happen to use the "convert" parameter,
> you just need to use it as a keyword parameter and not a
> positional one.)
> * decorator() should be applied to the function accepting the function
> being decorated ("entangle" by convention), not the caller.
> * Removed keyword argument "argsink" from decorator(),
> weak_signature_decorator() should be used instead.
>
> *Deprecations*
>
> * In widgets, template_vars in widgets are now called "params" and
> options_for has been renamed params_for
> * In widgets, the update_data method has been renamed update_params
> * Identity has moved to PEP8 style naming. Changed userId, groupId, and
> permissionId to be user_name, group_name, and permission_name.
> * visit_id has been deprecated in favor of visit_key
> * SQL scripts to migrate PostgreSQL and MySQL identity databases are
> available (http://trac.turbogears.org/turbogears/ticket/737)
>
>
> *Features*
>
> * Dramatically improved and unified logging configuration. Config files
> can now use the options in Python's logging module for log formats
> and output.
> * TurboGears now includes an enhanced version of Irmen de Jong's
> Kronos scheduler, allowing you to schedule tasks that run in
> separate threads or processes periodically.
> * For Python 2.3 users, there is a convenient new decorator syntax
> that comes from Phillip Eby's PEAK.
>
> Here's is the equivalent of @expose():
>
> [expose()]
> def index(self):
> pass
>
> * Added a new turbogears.start_server function which will help ease
> the transition to 1.1 *and* adds the ability to use Ian Bicking's
> EvalException. You must turn on tg.fancy_exception to use it
> at this point.
> * In widgets, if the widget you are using provides a default validator,
> for example a SelectionWidget, you can tweak its parameters
> by just passing a dictionary of those parameters as validator
> (for example, validator=dict(not_empty=True))
> * In widgets, every attribute listed inside params now supports callables
> automatically (the attribute will be called for computation at request
> time)
> * Some improvements to the ImageButton widget
> * More customization hooks for CheckBoxList, RadioButtonList, TableForm
> and ListForm
> * Decimals are properly jsonified (#472)
> * datetime.date instances are properly jsonified (#759)
> * Commas are supported in number validation (#720)
> * It's now possible to determine what permissions are required for
> a given controller method (#603)
>
> *Changes*
>
> * Identity model classes are now placed directly into the model.py of
> a quickstarted project. This new setup is much easier to change,
> since requirements for the identity model vary dramatically. Another
> advantage is that quickstart projects that don't need identity
> start off with cleaner code, and projects that do need identity
> need almost no additional configuration or setup.
> * quickstart projects include a "json.py" file as a home for JSON
> view code.
> * i18n "scan" command has been changed to "collect" to match the
> admi18n Toolbox tool
> * If you quickstart a project while in an svn checkout, files are no
> longer automatically "svn add"ed. This corrects some problems that
> people ran into with that behavior.
> * The "prod.cfg" file in quickstart projects is now called
> "sample-prod.cfg" to reflect that it is just used as a sample that
> you copy to your real production servers (#762).
> * The various classes used to make dictionaries look like normal
> objects have been replaced by turbogears.util.Bunch (#779)
>
> *Fixes*
>
> * Model Designer can now handle joins to the same table (#769)
> * Unicode values sent to the turbogears.url function are utf8 encoded.
> * NotEmpty validator works with CheckBoxList now. (#696)
> * Grid widget's css has been improved to not interact with other
> widgets (#729, thanks to [EMAIL PROTECTED])
> * the "self" parameter is no longer accidentally removed by validation
> * tg_format is properly stripped out for JSON requests (#740)
> * calendar widget language fixes (many language files needed patching)
> * DataController's float columns are properly converted (#707)
> * str values in Kid templates are now assumed to be utf8 rather than
> ASCII (changeable via kid.encoding) (#743)
> * The flash message set on the current request takes precedence over the
> one in the cookie (#747)
> * py:match was being used in the default templates in a way that would
> drop the text from the first node. (#785)
> * AutoCompleteField widget's only_suggest now works correctly when
> there is only one item listed (#750)
> * Lots of HTML cleanup
>
> *Project Updates*
>
> * TurboGears now uses ConfigObj 4.3.0 for configuration
> * MochiKit upgraded to 1.3
> * simplejson upgraded to 1.3
> * CherryPy upgraded to 2.2.1
> * Kid upgraded to 0.9.1
> * FormEncode upgraded to 0.5.1
> * PasteScript upgraded to 0.5.1
>
> *Contributors*
>
> Alberto Valverde González, Jeff Watkins, Max Ischenko, Michele Cella,
> Simon Belak, Jorge Godoy, Patrick Lewis, Jorge Vargas, Joost Moesker,
> Joseph Tate, Philip Walls, Bob Ippolito, Steve Bergman, Andrey Lebedev,
> Brian Beck, Roger Demetrescu.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---