Fixes and Enhancements since Version 0.5 alpha 3 |
Fixes and Enhancements since Version 0.5 alpha 3 |
|
|
|
- Added "paramstyle" support for SQL connections, which now have a |
|
'newParams()' method to create a parameter object, and an |
|
'addParam(params,value,name=None)' method to add parameters to the 'params' |
|
object (created via 'newParams()') and return the string that should be used |
|
to reference the parameter. |
|
|
|
This lets you write SQL generation code with embedded parameters using "bind |
|
variables". For example, you could do something like this, if 'db' is a SQL |
|
connection object:: |
|
|
|
params = db.newParams() |
|
sql = 'SELECT * FROM foobar WHERE baz='+db.addParam(params, 42) |
|
rows = db(sql, params) |
|
|
|
- The 'peak' script is now an .exe on Windows, using setuptools' "entry point" |
|
system. |
|
|
|
- PEAK no longer bundles any software that can be obtained automatically from |
|
PyPI. Running PEAK's setup script will attempt to download and install |
|
the needed packages. (Note that development snapshots of PEAK may require |
|
development snapshots of related packages.) |
|
|
|
- Added a series of new QueryDM and EntityDM convenience features. See |
|
"Making Data Managers easier to use":http://www.eby-sarna.com/pipermail/peak/2005-May/002296.html |
|
for a complete list and explanatory documentation. |
|
|
|
- Changed 'running.lookupCommand()' to use the command's 'getCommandParent()' |
|
method, so that commands using the '--config' option will utilize the |
|
specified configuration(s) to lookup subcommands. |
|
|
|
- Added a '-c/--config' option to PEAK bootstrap commands to load an .ini |
|
configuration file in a new service area before executing any subcommands. |
|
|
|
This allows you to do things like:: |
|
|
|
peak launch -c bulletins ref:sitemap@sitemap.xml |
|
|
|
which loads the 'bulletins' configuration file before launching the sitemap. |
|
Note that if you are subclassing 'commands.Bootstrap' you can suppress this |
|
option using 'options.reject_inheritance("-c","--config")' in the body of |
|
your subclass' class definition. You may wish to do this if your |
|
application's subcommands must run in the same service area as the parent |
|
command. (E.g. if the parent command expects the subcommand to partake in |
|
a transaction controlled by the parent command.) |
|
|
|
- Added a 'value' property to 'model.Enumeration', so that you can access |
|
an enumeration instance's value (i.e., the value it hashes and compares |
|
equal to) |
|
|
|
- Added a 'binding.hasParent(component,parent)' API function, which is |
|
specially optimized for use with generic functions, so that you can |
|
define generic function methods that apply only within some part of a |
|
component hierarchy. |
|
|
|
- PEAK no longer supports Python 2.2; Python 2.3.4 or better is required. |
|
|
|
- The kjbuckets extension module is no longer built and installed by default; |
|
you must explicitly enable it with a '--with-kjbuckets' flag passed to |
|
'setup.py'. Please port your code as soon as practical, this option will |
|
go away soon. |
|
|
|
- Use of the included 'kjbuckets' module is now DEPRECATED, due to increasing |
|
bitrot. Aaron Watters originally wrote this extension for Python 1.2, and |
|
it has not been well-maintained for newer versions of the Python/C API. |
|
Instead of 'kjSet' objects, use the Python 2.3 'Set' type, and instead of |
|
the 'kjGraph' type, use the new 'Graph' type in 'peak.util.Graph'. Some |
|
porting effort may be required, as these types are not precisely the same |
|
in signature as the originals. |
|
|
|
- The '_setNS()' method of the 'peak.util.SOX.ISOXNode_NS' interface has |
|
changed signature, due to a lack of use of the second argument in the code |
|
base, and its dependency on 'kjbuckets'. |
|
|
|
- The old 'peak.security' implementation has been removed, and replaced with |
|
a simpler, more flexible implementation based on generic functions (using |
|
less than half the code and seven fewer interfaces). Complete documentation |
|
and API tests for the new implementation can be found in 'rules.txt' in the |
|
'peak.security' package directory. |
|
|
|
Also, the new implemetation does not require redundant |
|
'security.allow(security.Anybody)' declarations just because you've declared |
|
other permissions for a class, so these declarations have been removed from |
|
``peak.web``. They don't do any harm, however, so you can leave them in |
|
your own code as long as you change them to use 'binding.metadata()' instead |
|
of the deprecated 'security.allow()'. |
|
|
|
- 'security.allow()' is now DEPRECATED; please use 'binding.metadata()' |
|
instead. (There is no change to the calling signature, but |
|
'binding.metadata' accepts any metadata, not just permissions.) |
|
|
|
- Added 'peak.running.options', a new option-parsing framework that extends |
|
'optparse' to support the PEAK 'commands' framework. Command instances |
|
can now refer to 'self.parsed_args' to find their non-option arguments, |
|
and to trigger setting of their attributes (or calling of methods) based on |
|
their raw arguments from 'self.argv'. See 'options.txt' in the |
|
'peak.running' package directory for a complete tutorial. |
|
|
|
- There is now a 'binding.initAttrs()' function that can be used to initialize |
|
an object's attributes from e.g. constructor keyword arguments, similar to |
|
how 'binding.Component' and 'binding.Attribute' constructors work. |
|
|
- Security permissions can now be declared as attribute metadata. |
- Security permissions can now be declared as attribute metadata. |
|
|
That is, instead of doing declarations like this:: |
That is, instead of doing declarations like this:: |