Mike Bayer [Fri, 10 Nov 2006 00:46:57 +0000 (00:46 +0000)]
- "delete-orphan" for a certain type can be set on more than one parent class;
the instance is an "orphan" only if its not attached to *any* of those parents
- better check for endless recursion in eagerloader.process_row
Mike Bayer [Fri, 3 Nov 2006 01:17:28 +0000 (01:17 +0000)]
- added an assertion within the "cascade" step of ORM relationships to check
that the class of object attached to a parent object is appropriate
(i.e. if A.items stores B objects, raise an error if a C is appended to A.items)
- new extension sqlalchemy.ext.associationproxy, provides transparent "association object"
mappings. new example examples/association/proxied_association.py illustrates.
- some example cleanup
Mike Bayer [Wed, 1 Nov 2006 03:30:16 +0000 (03:30 +0000)]
- fixed bug in circular dependency sorting at flush time; if object A
contained a cyclical many-to-one relationship to object B, and object B
was just attached to object A, *but* object B itself wasnt changed,
the many-to-one synchronize of B's primary key attribute to A's foreign key
attribute wouldnt occur. [ticket:360]
Mike Bayer [Tue, 24 Oct 2006 22:19:31 +0000 (22:19 +0000)]
- SingletonConnectionPool must use the "threadlocal" pooling behavior
- the "delete" cascade will load in all child objects, if they were not
loaded already. this can be turned off (i.e. the old behavior) by setting
passive_deletes=True on a relation().
Mike Bayer [Sun, 22 Oct 2006 00:24:26 +0000 (00:24 +0000)]
- attributes module and test suite moves underneath 'orm' package
- fixed table comparison example in metadata.txt
- docstrings all over the place
- renamed mapper _getattrbycolumn/_setattrbycolumn to get_attr_by_column,set_attr_by_column
- removed frommapper parameter from populate_instance(). the two operations can be performed separately
- fix to examples/adjacencytree/byroot_tree.py to fire off lazy loaders upon load, to reduce query calling
- added get(), get_by(), load() to MapperExtension
- re-implemented ExtensionOption (called by extension() function)
- redid _ExtensionCarrier to function dynamically based on __getattribute__
- added logging to attributes package, indicating the execution of a lazy callable
- going to close [ticket:329]
Mike Bayer [Thu, 19 Oct 2006 07:20:52 +0000 (07:20 +0000)]
- cleanup to the last commit
- added contains_eager() MapperOption, used in conjunction with
instances() to specify properties that should be eagerly loaded
from the result set, using their plain column names by default, or translated
given an custom row-translation function. [ticket:347].
Mike Bayer [Tue, 17 Oct 2006 02:03:00 +0000 (02:03 +0000)]
reorganizing classnames a bit, flagging "private" classes in the sql package,
getting the generated docs to look a little nicer.
fixes to extensions, sqlsoup etc. to be compatible with recent API tweaks
Mike Bayer [Mon, 16 Oct 2006 23:34:23 +0000 (23:34 +0000)]
- added "column_prefix=None" argument to mapper; prepends the
given string (typically '_') to column-based attributes automatically
set up from the mapper's Table
Mike Bayer [Sun, 15 Oct 2006 00:07:06 +0000 (00:07 +0000)]
- ForeignKey(Constraint) supports "use_alter=True", to create/drop a foreign key
via ALTER. this allows circular foreign key relationships to be set up.
Mike Bayer [Sat, 14 Oct 2006 21:58:04 +0000 (21:58 +0000)]
- a fair amount of cleanup to the schema package, removal of ambiguous
methods, methods that are no longer needed. slightly more constrained
useage, greater emphasis on explicitness.
- table_iterator signature fixup, includes fix for [ticket:288]
- the "primary_key" attribute of Table and other selectables becomes
a setlike ColumnCollection object; is no longer ordered or numerically
indexed. a comparison clause between two pks that are derived from the
same underlying tables (i.e. such as two Alias objects) can be generated
via table1.primary_key==table2.primary_key
- append_item() methods removed from Table and Column; preferably
construct Table/Column/related objects inline, but if needed use
append_column(), append_foreign_key(), append_constraint(), etc.
- table.create() no longer returns the Table object, instead has no
return value. the usual case is that tables are created via metadata,
which is preferable since it will handle table dependencies.
- added UniqueConstraint (goes at Table level), CheckConstraint
(goes at Table or Column level) fixes [ticket:217]
- index=False/unique=True on Column now creates a UniqueConstraint,
index=True/unique=False creates a plain Index,
index=True/unique=True on Column creates a unique Index. 'index'
and 'unique' keyword arguments to column are now boolean only; for
explcit names and groupings of indexes or unique constraints, use the
UniqueConstraint/Index constructs explicitly.
- relationship of Metadata/Table/SchemaGenerator/Dropper has been
improved so that the schemavisitor receives the metadata object
for greater control over groupings of creates/drops.
- added "use_alter" argument to ForeignKey, ForeignKeyConstraint,
but it doesnt do anything yet. will utilize new generator/dropper
behavior to implement.
Mike Bayer [Sat, 14 Oct 2006 07:57:12 +0000 (07:57 +0000)]
a simplification to syncrule generation, which also allows more flexible configuration
of which columns are to be involved in the synchronization via foreignkey property.
foreignkey param is a little more important now and should have its role clarified
particularly for self-referential mappers.
Mike Bayer [Fri, 13 Oct 2006 16:38:21 +0000 (16:38 +0000)]
- sync checks destination column for primary key status, will not set it to None in that case
- dependency non-passively loads child items for many-to-one post update check