From c081749aa65d148fea40adc940fa7ebbfb892224 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 13 Mar 2006 17:32:13 +0000 Subject: [PATCH] more notes, docs --- CHANGES | 26 +++++++++++++++++++++++--- doc/build/content/datamapping.myt | 9 ++------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index fbcd7661c5..6d73ccaba9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 0.1.4 -- create_engine() now uses genericized parameters; host/hostname, db/dbname/database, password/passwd, etc. for all engine connections. makes engine URIs much more "universal" +- create_engine() now uses genericized parameters; host/hostname, db/dbname/database, +password/passwd, etc. for all engine connections. makes engine URIs much more "universal" - added support for SELECT statements embedded into a column clause, using the flag "scalar=True" - another overhaul to EagerLoading when used in conjunction with mappers that @@ -13,8 +14,8 @@ if query returns more than one object row, selectfirst() to not throw the exception. also adds selectfirst_by (synonymous with get_by) and selectone_by - added onupdate parameter to Column, will exec SQL/python upon an update statement.Also adds "for_update=True" to all DefaultGenerator subclasses -- added user-contributed support for Oracle table reflection; still -some bugs to work out regarding composite primary keys/dictionary selection +- added support for Oracle table reflection contributed by Andrija Zaric; +still some bugs to work out regarding composite primary keys/dictionary selection - checked in an initial Firebird module, awaiting testing. - added sql.ClauseParameters dictionary object as the result for compiled.get_params(), does late-typeprocessing of bind parameters so @@ -27,6 +28,19 @@ perform unicode encoding/decoding (makes Strings act like Unicodes) - added 'encoding="utf8"' parameter to engine. the given encoding will be used for all encode/decode calls within Unicode types as well as Strings when convert_unicode=True. +- improved support for mapping against UNIONs, added polymorph.py example +to illustrate multi-class mapping against a UNION +- fix to SQLite LIMIT/OFFSET syntax +- fix to Oracle LIMIT syntax +- added backref() function, allows backreferences to have keyword arguments +that will be passed to the backref. +- Sequences and ColumnDefault objects can do execute()/scalar() standalone +- SQL functions (i.e. func.foo()) can do execute()/scalar() standalone +- fix to SQL functions so that the ANSI-standard functions, i.e. current_timestamp +etc., do not specify parenthesis. all other functions do. +- added settattr_clean and append_clean to SmartProperty, which set +attributes without triggering a "dirty" event or any history. used as: +myclass.prop1.setattr_clean(myobject, 'hi') - improved support to column defaults when used by mappers; mappers will pull pre-executed defaults from statement's executed bind parameters (pre-conversion) to populate them into a saved object's attributes; if any @@ -37,6 +51,12 @@ refresh() themselves upon the next attribute access. - improvements to SQL func calls including an "engine" keyword argument so they can be execute()d or scalar()ed standalone, also added func accessor to SQLEngine +- fix to MySQL4 custom table engines, i.e. TYPE instead of ENGINE +- slightly enhanced logging, includes timestamps and a somewhat configurable +formatting system, in lieu of a full-blown logging system +- improvements to the ActiveMapper class from the TG gang, including +many-to-many relationships +- added Double and TinyInt support to mysql 0.1.3 - completed "post_update" feature, will add a second update statement before diff --git a/doc/build/content/datamapping.myt b/doc/build/content/datamapping.myt index 35493247cc..febf9bf8be 100644 --- a/doc/build/content/datamapping.myt +++ b/doc/build/content/datamapping.myt @@ -343,19 +343,14 @@ DELETE FROM addresses WHERE addresses.address_id = :address_id True -+

The backreference feature also works with many-to-many relationships, which are described later. When creating a backreference, a corresponding property is placed on the child mapper. This property can be overridden with a custom property using the add_property function: ++

The backreference feature also works with many-to-many relationships, which are described later. When creating a backreference, a corresponding property is placed on the child mapper. The default arguments to this property can be overridden using the backref() function: <&|formatting.myt:code&> Address.mapper = mapper(Address, addresses) User.mapper = mapper(User, users, properties = { - 'addresses' : relation(Address.mapper, backref='user') + 'addresses' : relation(Address.mapper, backref=backref('user', lazy=False, private=True)) } ) - - Address.mapper.add_property('user', relation( - User.mapper, lazy=False, private=True, backref='addresses' - )) -

Note that when overriding a backreferenced property, we re-specify the backreference as well. This will not override the existing 'addresses' property on the User class, but just sends a message to the attribute-management system that it should continue to maintain this backreference.

-- 2.47.2