Commit Graph

185 Commits

Author SHA1 Message Date
Mike Bayer f2b43da1a8 tidy test/base, test/ex, test/ext 2010-07-11 13:41:38 -04:00
Mike Bayer d6614c63b2 transfer docstrings from @classproperty to props 2010-07-04 12:06:19 -04:00
Mike Bayer 55ae7d7842 - Added support for @classproperty to provide
any kind of schema/mapping construct from a
declarative mixin, including columns with foreign
keys, relationships, column_property, deferred.
This solves all such issues on declarative mixins.
An error is raised if any MapperProperty subclass
is specified on a mixin without using @classproperty.
[ticket:1751] [ticket:1796] [ticket:1805]

- un-anglicized the declarative docs
2010-07-03 14:53:37 -04:00
Mike Bayer 0025a6a50e - The 'default' compiler is automatically copied over
when overriding the compilation of a built in
clause construct, so no KeyError is raised if the
user-defined compiler is specific to certain
backends and compilation for a different backend
is invoked. [ticket:1838]
2010-07-02 14:07:42 -04:00
Chris Withers 3c56bfde95 keep ordering of columns with mixins constant 2010-07-02 14:57:19 +01:00
Mike Bayer 29eb88eefb - Fixed bug that would prevent overridden clause
compilation from working for "annotated" expression
elements, which are often generated by the ORM.
2010-06-26 17:20:17 -04:00
Mike Bayer 6de7db07ce - a mixin class can now define a column that matches
one which is present on a __table__ defined on a
subclass.  It cannot, however, define one that is
not present in the __table__, and the error message
here now works.  [ticket:1821]
2010-06-19 13:25:37 -04:00
Mike Bayer a8e53a4f31 - Column.copy() takes along the "unique" attribute
among others, fixes [ticket:1829] regarding declarative
mixins
2010-06-15 17:56:17 -04:00
Mike Bayer 0934e217f8 - the SqlSoup constructor accepts a base argument which specifies
the base class to use for mapped classes, the default being
`object`.  [ticket:1783]
2010-05-08 15:08:48 -04:00
Chris Withers 5114807408 docs for new mixin class control abilities 2010-04-13 16:46:07 +01:00
Chris Withers 80897e74cb add another edge case example 2010-04-13 16:28:32 +01:00
Chris Withers aaa0ba0525 helper method for spotting inherited tables 2010-04-13 11:29:39 +01:00
Chris Withers 7339ee67e1 correct ordering 2010-04-13 01:55:32 +01:00
Chris Withers 67cdce0549 beef up test cases to reveal that I'm not as close as I'd thought :-( 2010-04-13 00:56:15 +01:00
Chris Withers 5762c9c12b correct this test case 2010-04-12 23:22:44 +01:00
Chris Withers 6fc4cba130 improve test case correctness 2010-04-09 19:02:32 +01:00
Chris Withers 5fd49b42ea learn to spell 2010-04-09 17:35:16 +01:00
Chris Withers 03ac691bd2 more testcases for propogation with mixins in declarative 2010-04-09 17:32:05 +01:00
Chris Withers 736682a589 ugh, didn't mean to commit that :-S 2010-04-07 18:14:06 +01:00
Chris Withers a5c9696a7c Add instructions to install nose adn NB that it won't happen by magic 2010-04-07 18:09:21 +01:00
Mike Bayer e9cdc0b86e test another version of the mixin here 2010-04-06 12:32:51 -04:00
Mike Bayer 87b454be9a - Further reworked the "mixin" logic in declarative to
additionally allow __mapper_args__ as a @classproperty
on a mixin, such as to dynamically assign polymorphic_identity.
2010-04-06 12:27:01 -04:00
Mike Bayer 3467339f7e remove erronrous link to "addresses" 2010-04-02 16:15:17 -04:00
Mike Bayer a3a85ed54f - Declarative will raise an informative error message
if a non-mapped class attribute is referenced in the
string-based relationship() arguments.
2010-04-02 12:42:54 -04:00
Mike Bayer 43b9f0d116 - the compiler extension now allows @compiles decorators
on base classes that extend to child classes, @compiles
decorators on child classes that aren't broken by a
@compiles decorator on the base class.
2010-03-30 10:39:36 -04:00
Mike Bayer 51fd344737 - The sqlalchemy.orm.shard module now becomes an extension,
sqlalchemy.ext.horizontal_shard.   The old import
works with a deprecation warning.
2010-03-28 13:12:38 -04:00
Mike Bayer b7a2d7de48 - relationships and columns with foreign keys aren't
allowed on declarative mixins, sorry.  [ticket:1751]
2010-03-26 23:14:16 -04:00
Mike Bayer 15159a844d - Using @classdecorator and similar on mixins to define
__tablename__, __table_args__, etc. now works if
the method references attributes on the ultimate
subclass. [ticket:1749]
2010-03-26 15:16:00 -04:00
Mike Bayer 03573c0517 - Using a mixin won't break if the mixin implements an
unpredictable __getattribute__(), i.e. Zope interfaces.
[ticket:1746]
2010-03-25 17:25:32 -04:00
Mike Bayer c6bceb7775 - converted all lazy=True|False|None to 'select'|'joined'|'noload'
- converted all eager to joined in examples
- fixed beaker/advanced.py to reference RelationshipCache
2010-03-24 19:19:03 -04:00
Mike Bayer 1675811029 - To accomodate the fact that there are now two kinds of eager
loading available, the new names for eagerload() and
eagerload_all() are joinedload() and joinedload_all().  The
old names will remain as synonyms for the foreseeable future.

- The "lazy" flag on the relationship() function now accepts
a string argument for all kinds of loading: "select", "joined",
"subquery", "noload" and "dynamic", where the default is now
"select".  The old values of True/
False/None still retain their usual meanings and will remain
as synonyms for the foreseeable future.

- Added documentation to tutorial,mapper doc, api docs
for subqueryload, subqueryload_all, and other options.
2010-03-24 19:11:01 -04:00
Mike Bayer 5f15e5569c - An exception is raised when a single-table subclass specifies
a column that is already present on the base class.
[ticket:1732]
2010-03-19 13:23:06 -04:00
Mike Bayer 065fcbd9d2 - The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term.  relation() however will remain available
in equal capacity for the foreseeable future.  [ticket:1740]
2010-03-17 17:48:29 -04:00
Mike Bayer 67f5f4831b - fix the sqlalchemy.test.schema.Column function to work with copies
- add sequences to new associationproxy tests
- test/ext passes 100% on oracle here
2010-03-11 18:01:04 +00:00
Mike Bayer e45a14e6fc add autoincrement flags to decls 2010-03-11 17:43:34 +00:00
Chris Withers a1337a822a fixes for some nasty edge cases when usng descriptors to compute special attributes 2010-03-02 10:17:31 +00:00
Chris Withers 8aaf3da70a allow __tablename__ to come from a mixin 2010-03-01 18:10:23 +00:00
Chris Withers 83d7d12b0a paranoid test that single table inheritance works with single table inheritance 2010-03-01 17:59:19 +00:00
Michael Trier 65be1c2415 Corrected problem with index too large on mysql. 2010-02-26 06:30:14 +00:00
Mike Bayer f60a5fbd5d - merge -r6823:6841 of branches/chrisw_mixin
- declarative now accepts mixin classes directly, as a means
to provide common functional and column-based elements on
all subclasses, as well as a means to propagate a fixed
set of __table_args__ or __mapper_args__ to subclasses.
For custom combinations of __table_args__/__mapper_args__ from
an inherited mixin to local, descriptors can now be used.
New details are all up in the Declarative documentation.
Thanks to Chris Withers for putting up with my strife
on this. [ticket:1707]
2010-02-25 23:15:39 +00:00
Mike Bayer bee34dfcd6 - a change to the previous __mapper_args__ commit.
- the __mapper_args__ dict is copied when propagating to a subclass,
and is taken straight off the class __dict__ to avoid any
propagation from the parent.  mapper inheritance already
propagates the things you want from the parent mapper.
[ticket:1393]
2010-02-23 00:57:08 +00:00
Mike Bayer c2060e8943 - the __mapper_args__ dict is copied when propagating to a subclass.
Still need to decide how the argument propagation should
work in the bigger picture.  [ticket:1393]
2010-02-23 00:39:35 +00:00
Mike Bayer 75c5c0322f - DeclarativeMeta exclusively uses cls.__dict__ (not dict_)
as the source of class information; _as_declarative exclusively
uses the  dict_ passed to it as the source of class information
(which when using DeclarativeMeta is cls.__dict__).  This should
in theory make it easier for custom metaclasses to modify
the state passed into _as_declarative.
2010-02-22 22:31:49 +00:00
Mike Bayer b3f1513eaf clean up some skips, added skip for sqlite + python2 2010-02-21 21:26:11 +00:00
Mike Bayer 739b7b0c25 some more 2.4 test fixes 2010-02-15 22:37:37 +00:00
Mike Bayer 5935b9e367 for string deferred evals, don't return the underlying Column, rely upon the original propcomparator to do what it wants.
reduces duplication of the "columns[0]" rule and removes potentially surprise behavior from the eval
2010-01-29 18:55:03 +00:00
Mike Bayer 0b185fc84f - make frozendict serializable
- serialize tests use HIGHEST_PROTOCOL
2010-01-28 22:47:25 +00:00
Mike Bayer ba53c6e844 added a test to ensure the concrete example in the docs works 2010-01-25 16:22:07 +00:00
Mike Bayer 2d15d9b0d0 - association_proxy now has basic comparator methods .any(),
.has(), .contains(), ==, !=, thanks to Scott Torborg.
[ticket:1372]
2010-01-22 20:24:27 +00:00
Mike Bayer 196284c083 - ensure correct session usage + tests 2010-01-21 20:41:52 +00:00