Commit Graph

413 Commits

Author SHA1 Message Date
Mike Bayer dda33be687 cleanup 2012-12-03 19:01:25 -05:00
Richard Mitchell 92535b4b57 Allow use of synonyms in primaryjoin / secondaryjoin conditions 2012-11-27 14:03:42 +00:00
Mike Bayer 4356741c48 - hstore adjustments 2012-11-17 20:45:17 -05:00
Mike Bayer 63a9d80f18 - store only MultipleClassMarkers inside of ModuleMarker, then
store ModuleMarkers for multiple roots, one for each token in a
module path.  this allows partial path resolution.
- docs to this effect
2012-10-28 14:15:56 -04:00
Mike Bayer bac14cdf47 Added a new method :meth:.Engine.execution_options
to :class:`.Engine`.  This method works similarly to
      :class:`.Connection.execution_options` in that it creates
      a copy of the parent object which will refer to the new
      set of options.   The method can be used to build
      sharding schemes where each engine shares the same
      underlying pool of connections.   The method
      has been tested against the horizontal shard
      recipe in the ORM as well.
2012-10-23 12:08:20 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer 7e815c67a9 finished fixes for mxodbc; need to use at least version 3.2.1 2012-09-21 17:43:22 -04:00
Mike Bayer 062f0a202a - [bug] Fixed a disconnect that slowly evolved
between a @declared_attr Column and a
directly-defined Column on a mixin. In both
cases, the Column will be applied to the
declared class' table, but not to that of a
joined inheritance subclass.   Previously,
the directly-defined Column would be placed
on both the base and the sub table, which isn't
typically what's desired.  [ticket:2565]
2012-09-14 21:58:19 -04:00
Mike Bayer 1c325dc9c7 - [feature] Added a hook to the system of rendering
CREATE TABLE that provides access to the render for each
Column individually, by constructing a @compiles
function against the new schema.CreateColumn
construct.  [ticket:2463]
2012-09-09 14:39:25 -04:00
Mike Bayer df7a3792f5 - add req's for predictable gc 2012-09-05 12:46:28 -04:00
Mike Bayer 28be45cb54 oops, one more 2012-08-29 17:29:08 -04:00
Mike Bayer 561c71ff55 - skip this on oracle 2012-08-29 16:25:20 -04:00
Mike Bayer 656cb6461b - [feature] declared_attr can now be used with
attributes that are not Column or MapperProperty;
including any user-defined value as well
as association proxy objects.  [ticket:2517]
2012-08-27 16:44:34 -04:00
Mike Bayer 640625bc9e - [feature] Conflicts between columns on
single-inheritance declarative subclasses,
    with or without using a mixin, can be resolved
    using a new @declared_attr usage described
    in the documentation.  [ticket:2472]
2012-08-27 16:04:16 -04:00
Mike Bayer ca049bc670 remove duped test 2012-08-15 18:48:54 -04:00
Mike Bayer 54808ecccd - [bug] Declarative can now propagate a column
declared on a single-table inheritance subclass
up to the parent class' table, when the parent
class is itself mapped to a join() or select()
statement, directly or via joined inheritane,
and not just a Table.   [ticket:2549]
2012-08-15 18:42:59 -04:00
Mike Bayer 7a81ecc82c - adjustments for py3.3 unit tests, [ticket:2542] 2012-08-11 21:46:48 -04:00
Mike Bayer 6bd46945cc - reorganization of declarative such that file sizes are managable again.
the vast majority of file lines are spent on documentation, which moves
into package __init__.  The core declarative idea lives in base and
is back down to its originally low size of under 500 lines.  The various
helpers and such move into api.py, and the full span of string lookup
moves into a new module clsregistry.  the rest of declarative only
refers to two functions in clsregistry in three places inside of base.
- [feature] Declarative now maintains a registry
of classes by string name as well as by full
module-qualified name.   Multiple classes with the
same name can now be looked up based on a module-qualified
string within relationship().   Simple class name
lookups where more than one class shares the same
name now raises an informative error message.
[ticket:2338]
- lots of tests to ensure the new weak referencing memory management
is maintained by the new class registry system.   this ticket was
served very well by waiting to do #2526 first, else this would
have needed to be rewritten anyway.
2012-08-05 15:14:51 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer 9c0de7fcf7 - with InstanceState more public, underscore all its methods
that change object state as these aren't intended for public
use.
2012-07-18 16:43:02 -04:00
Mike Bayer de115ae406 - a big renaming of all the _Underscore classes to have
plain names.  The old names are still defined for
backwards compatibility.
- _BindParamClause renamed to BindParameter
2012-07-17 20:04:22 -04:00
Mike Bayer ce9a702dbd - express most of the orm.util functions in terms of the inspection system
- modify inspection system:
	1. raise a new exception for any case where the inspection
        context can't be returned.  this supersedes the "not mapped"
        errors.
        2. don't configure mappers on a mapper inspection.  this allows
        the inspectors to be used during mapper config time.  instead,
        the mapper configures on "with_polymorphic_selectable" now,
        which is needed for all queries
- add a bunch of new "is_XYZ" attributes to inspectors
- finish making the name change of "compile" -> "configure", for some reason
this was only done partially
2012-07-16 17:29:02 -04:00
Mike Bayer fce89ccf0c - [bug] Fixed bug mostly local to new
AbstractConcreteBase helper where the "type"
    attribute from the superclass would not
    be overridden on the subclass to produce the
    "reserved for base" error message, instead placing
    a do-nothing attribute there.  This was inconsistent
    vs. using ConcreteBase as well as all the behavior
    of classical concrete mappings, where the "type"
    column from the polymorphic base would be explicitly
    disabled on subclasses, unless overridden
    explicitly.
2012-07-14 20:33:16 -04:00
Mike Bayer 319aa982a1 - [moved] The InstrumentationManager interface
and the entire related system of alternate
class implementation is now moved out
to sqlalchemy.ext.instrumentation.   This is
a seldom used system that adds significant
complexity and overhead to the mechanics of
class instrumentation.  The new architecture
allows it to remain unused until
InstrumentationManager is actually imported,
at which point it is bootstrapped into
the core.
2012-06-24 02:06:10 -04:00
Mike Bayer e47f2e03ce 2.5 compat 2012-06-23 15:37:18 -04:00
Mike Bayer b1bcff3af9 dbs like oracle can't handle these tests since we aren't applying a sequence
to the reflected table
2012-06-16 20:10:30 -04:00
Mike Bayer e2c612d24d get __clause_element__ for remote()/foreign() annotation, [ticket:2493] 2012-05-24 11:12:39 -04:00
Mike Bayer 227f7facd9 - [bug] Fixed bug in declarative
whereby the precedence of columns
in a joined-table, composite
column (typically for id) would fail to
be correct if the columns contained
names distinct from their attribute
names.  This would cause things like
primaryjoin conditions made against the
entity attributes to be incorrect.  Related
to [ticket:1892] as this was supposed
to be part of that, this is [ticket:2491].
Also in 0.7.8.
2012-05-24 10:17:54 -04:00
Mike Bayer fbd75af4a7 ignore columns that don't resolve here either. 2012-05-19 19:33:58 -04:00
Mike Bayer 6c09e98013 - reorganize the usage of __mapper_args__ so that it's only
called after the __prepare__() step, if any, so that everything to
do with the mapping occurs after the table is reflected.
2012-05-18 10:55:28 -04:00
Mike Bayer c550db78b2 fix mysql 2012-05-17 12:12:05 -04:00
Mike Bayer 2925167550 - [feature] The "deferred declarative
reflection" system has been moved into the
declarative extension itself, using the
new DeferredReflection class.  This
class is now tested with both single
and joined table inheritance use cases.
[ticket:2485]
- [bug] The autoload_replace flag on Table,
when False, will cause any reflected foreign key
constraints which refer to already-declared
columns to be skipped, assuming that the
in-Python declared column will take over
the task of specifying in-Python ForeignKey
or ForeignKeyConstraint declarations.
2012-05-17 11:45:05 -04:00
Mike Bayer da8032dc45 - add DeferredReflection to declarative itself
- split out test_declarative into four separate modules
2012-05-17 10:57:31 -04:00
Mike Bayer 458c38087f another pypy skip 2012-04-24 23:40:00 -04:00
Mike Bayer 197e5ea941 adjust some test exclusions 2012-04-24 20:44:21 -04:00
Mike Bayer ae90ba28e8 fix import here 2012-04-24 16:03:51 -04:00
Mike Bayer cb15295850 - remove sqlsoup [ticket:2262]
- remove sqlalchemy.exceptions [ticket:2433]
2012-04-24 13:14:08 -04:00
Mike Bayer 713a4e19fa - merged #1401 branch from bitbucket
- resolved some serious speed hits I missed, we need to ensure
only deannotated columns are used in the local/remote collections and soforth
so that hash lookups against mapped columns don't dig into __eq__()
- fix some other parity mismatches regarding stuff from [ticket:2453],
including finding another case where _deep_annotate() was doing the wrong thing,
new tests.
- [feature] Major rewrite of relationship()
internals now allow join conditions which
include columns pointing to themselves
within composite foreign keys.   A new
API for very specialized primaryjoin conditions
is added, allowing conditions based on
SQL functions, CAST, etc. to be handled
by placing the annotation functions
remote() and foreign() inline within the
expression when necessary.  Previous recipes
using the semi-private _local_remote_pairs
approach can be upgraded to this new
approach. [ticket:1401]
2012-04-22 19:43:31 -04:00
Mike Bayer 4ffcc52c46 - move create_lazy_clause() to relationships
- add foreign, remote annotations to declarative
2012-04-01 18:18:12 -04:00
Mike Bayer 2563b33453 - [bug] Fixed bug which would prevent
OrderingList from being pickleable
[ticket:2454].  Courtesy Jeff Dairiki
2012-04-01 11:01:56 -04:00
Mike Bayer 0634ea79b1 many fixes but still can't get heuristics to work as well as what's existing,
tests still failing
2012-02-11 15:43:05 -05:00
Mike Bayer 9e56ff1a44 another py3k fix 2012-01-28 16:04:38 -05:00
Mike Bayer 029ae72b2f - [bug] Fixed bug where unpickled object didn't
have enough of its state set up to work
correctly within the unpickle() event established
by the mutable object extension, if the object
needed ORM attribute access within
__eq__() or similar. [ticket:2362]
2012-01-28 13:48:05 -05:00
Mike Bayer 378e86124b - [bug] Fixed regression from 0.7.4 whereby
using an already instrumented column from a
superclass as "polymorphic_on" failed to resolve
the underlying Column.  [ticket:2345]
2012-01-28 10:45:23 -05:00
Mike Bayer d706a66170 - [bug] implemented standard "can't set attribute" /
"can't delete attribute" AttributeError when
setattr/delattr used on a hybrid that doesn't
define fset or fdel. [ticket:2353]
2012-01-27 20:59:33 -05:00
Mike Bayer 7f07d43fb1 - [feature] Added "class_registry" argument to
declarative_base().  Allows two or more declarative
bases to share the same registry of class names.
2011-12-28 11:10:49 -05:00
Mike Bayer c4506b8c90 - [bug] Fixed bug whereby hybrid_property didn't
work as a kw arg in any(), has().
2011-12-11 10:41:33 -05:00
Mike Bayer 5c9d53fb02 - [bug] the @compiles decorator raises an
informative error message when no "default"
compilation handler is present, rather
than KeyError.
2011-12-06 12:49:39 -05:00
Mike Bayer 7f68a3a527 - [bug] __table_args__ can now be passed as
an empty tuple as well as an empty dict.
[ticket:2339].  Thanks to Fayaz Yusuf Khan
for the patch.
2011-12-04 14:28:57 -05:00
Mike Bayer 699146086d - [bug] Fixed bug whereby column_property() created
against ORM-level column could be treated as
a distinct entity when producing certain
kinds of joined-inh joins.  [ticket:2316]

- [bug] related to [ticket:2316], made some
adjustments to the change from [ticket:2261]
regarding the "from" list on a select(). The
_froms collection is no longer memoized, as this
simplifies various use cases and removes the
need for a "warning" if a column is attached
to a table after it was already used in an
expression - the select() construct will now
always produce the correct expression.
There's probably no real-world
performance hit here; select() objects are
almost always made ad-hoc, and systems that
wish to optimize the re-use of a select()
would be using the "compiled_cache" feature.
A hit which would occur when calling select.bind
has been reduced, but the vast majority
of users shouldn't be using "bound metadata"
anyway :).
2011-12-03 19:50:01 -05:00