Commit Graph

277 Commits

Author SHA1 Message Date
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
Mike Bayer 5d6376fbd5 - [bug] Fixed bug whereby a subclass of a subclass
using concrete inheritance in conjunction with
the new ConcreteBase or AbstractConcreteBase
would fail to apply the subclasses deeper than
one level to the "polymorphic loader" of each
base  [ticket:2312]

- [bug] Fixed bug whereby a subclass of a subclass
using the new AbstractConcreteBase would fail
to acquire the correct "base_mapper" attribute
when the "base" mapper was generated, thereby
causing failures later on.  [ticket:2312]
2011-10-28 17:46:28 -04:00
Mike Bayer d9adb2a4fd - [bug] the value of a composite attribute is now
expired after an insert or update operation, instead
of regenerated in place.  This ensures that a
column value which is expired within a flush
will be loaded first, before the composite
is regenerated using that value.  [ticket:2309]

- [bug] The fix in [ticket:2309] also emits the
"refresh" event when the composite value is
loaded on access, even if all column
values were already present, as is appropriate.
This fixes the "mutable" extension which relies
upon the "load" event to ensure the _parents
dictionary is up to date, fixes [ticket:2308].
Thanks to Scott Torborg for the test case here.
2011-10-26 12:41:18 -04:00
Mike Bayer 57c03e471a fix this for oracle 2011-10-15 17:17:33 -04:00
Mike Bayer 5ca662f7bc warn when a subclass' base uses @declared_attr for a regular column -
does not propagate to subclasses.  [ticket:2283]
2011-09-26 17:43:53 -04:00
Mike Bayer 1cf80dc5b2 - Changed the update() method on association proxy
dictionary to use a duck typing approach, i.e.
    checks for "keys", to discern between update({})
    and update((a, b)).   Previously, passing a
    dictionary that had tuples as keys would be misinterpreted
    as a sequence. [ticket:2275]
2011-09-14 11:31:33 -04:00
Mike Bayer bb62d80217 - New event hook, MapperEvents.after_configured().
Called after a configure() step has completed and
    mappers were in fact affected.   Theoretically this
    event is called once per application, unless new mappings
    are constructed after existing ones have been used
    already.

  - New declarative features:
        - __declare_last__() method, establishes an event
        listener for the class method that will be called
        when mappers are completed with the final "configure"
        step.
        - __abstract__ flag.   The class will not be mapped
        at all when this flag is present on the class.
        - New helper classes ConcreteBase, AbstractConcreteBase.
        Allow concrete mappings using declarative which automatically
        set up the "polymorphic_union" when the "configure"
        mapper step is invoked.
        - The mapper itself has semi-private methods that allow
        the "with_polymorphic" selectable to be assigned
        to the mapper after it has already been configured.
        [ticket:2239]
2011-09-10 16:54:23 -04:00
Mike Bayer 1492cc634e - Fixed bug whereby if __eq__() was
redefined, a relationship many-to-one lazyload
would hit the __eq__() and fail.  [ticket:2260]
Does not apply to 0.6.9.
2011-09-09 15:51:40 -04:00
Mike Bayer 4fe4590a45 - rewrite the docs for association proxy using declarative, add new examples, querying,
etc., part of [ticket:2246]
- add some accessors to AssociationProxy for attributes, test in join(), [ticket:2236]
- update relationship docs to talk about callables, part of [ticket:2246]
2011-08-05 21:29:21 -04:00
Mike Bayer c1295ce57b - Added an informative error message when
ForeignKeyConstraint refers to a column name in
    the parent that is not found.  Also in 0.6.9.
- add tests for [ticket:2226], as if we hit each @declared_attr
directly with obj.__get__(obj, name) instead of using
getattr(cls, name).  Basic inheritance mechanics are improperly
used in this case, so 2226 is invalid.
2011-07-21 11:44:31 -04:00
Mike Bayer 409a95adf4 - Fixed bug in the mutable extension whereby
if None or a non-corresponding type were set,
    an error would be raised.  None is now accepted
    which assigns None to all attributes,
    illegal values raise ValueError.
2011-07-01 11:32:07 -04:00
Mike Bayer 287e9d6a77 - Fixed bug in the mutable extension whereby
if the same type were used twice in one
    mapping, the attributes beyond the first
    would not get instrumented.
2011-06-30 10:43:53 -04:00
Mike Bayer 23a14f29da - Fixed declarative bug where a class inheriting
from a superclass of the same name would fail
due to an unnecessary lookup of the name
in the _decl_class_registry. [ticket:2194]
2011-06-14 10:08:34 -04:00
Mike Bayer 5cac2468b6 - Repaired new "mutable" extension to propagate
events to subclasses correctly; don't
create multiple event listeners for
subclasses either.  [ticket:2180]
2011-06-04 19:43:39 -04:00
Mike Bayer 953d72df6b py3k test fix 2011-05-14 13:54:00 -04:00
Mike Bayer 501b8aec1b - Fixed bugs in sqlalchemy.ext.mutable extension where
`None` was not appropriately handled, replacement
    events were not appropriately handled.
    [ticket:2143]
2011-05-14 10:23:12 -04:00
Mike Bayer e1ec36fc9e - hardcore force every connection into a strong-referenced set, rollback on every test, close on every context.
this uses pool events but bypasses the pool's fairy/record/dispose services.   pypy still seems to expose
some holes in that at least as far as what some (or maybe just one, cant find it yet) of the tests does.
haven't tested this too deeply, just on sqlite + postgres, cypthon 2.7 + pypy.   will see what the buildbot
says
2011-04-25 21:50:26 -04:00
Michael Trier b435b01f7a Exclude serializer test on pypy. Problem in pickle. 2011-04-24 20:52:15 -04:00
Mike Bayer cfc1274834 - add some function examples, [ticket:2107]
- have "packagenames" be present on FunctionElement by default
so that compiler.visit_function() can be called
- add a test for that
2011-04-02 16:32:05 -04:00
Mike Bayer 8058c7089f - do a close() here so that objects are guaranteed loaded new 2011-03-27 19:26:47 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer a3083eabf4 - move all the setup_classes(cls) and setup_mappers(cls) to use a
local cls.Basic, cls.Comparable base class so that there is no ambiguity
or hash identity behaviors getting in the way of class registration.
2011-03-27 15:04:06 -04:00
Mike Bayer 14a2fae239 - remove @testing.resolve_artifact_names, replace with direct attribute
access to the cls/self.tables/classes registries
- express orm/_base.py ORMTest in terms of engine/_base.py TablesTest,
factor out common steps into TablesTest, remove AltEngineTest as a
separate class.   will further consolidate these base classes
2011-03-26 19:03:11 -04:00
Alex Gaynor 0cf1a29b72 this test fails on PyPy because it checks for a lastrowid after the connection is lcosed 2011-03-16 14:18:27 -04:00
Taavi Burns f9e58cad3b Fix 3 errors in py32, from patch from lsblakk. There are still 8 failures. See #2088. 2011-03-16 00:32:33 -04:00
Taavi Burns af69b2bdf7 Pulling 32d2b5d196 onto default from rel_0_6 2011-03-15 17:54:11 -04:00
Mike Bayer a3c1774859 - Arguments in __mapper_args__ that aren't "hashable"
aren't mistaken for always-hashable, possibly-column
arguments.  [ticket:2091]
2011-03-14 15:01:17 -04:00
Mike Bayer e7c5fd7b22 - the dictionary at the end of the __table_args__
tuple is now optional.  [ticket:1468]
2011-02-17 12:06:56 -05:00
Mike Bayer 26605268bc add a close to this as PG appears to be hanging 2011-02-14 17:17:29 -05:00
Mike Bayer 0cee3f6cf0 - Fixed regression whereby composite() with
Column objects placed inline would fail
to initialize.  The Column objects can now
be inline with the composite() or external
and pulled in via name or object ref.
[ticket:2058]
2011-02-14 12:51:53 -05:00
Mike Bayer 2722035809 - Association proxy now has correct behavior for
any(), has(), and contains() when proxying
a many-to-one scalar attribute to a one-to-many
collection (i.e. the reverse of the 'typical'
association proxy use case)  [ticket:2054]
2011-02-13 20:20:34 -05:00
Mike Bayer de9ec22de9 - Added an explicit check for the case that the name
'metadata' is used for a column attribute on a
declarative class. [ticket:2050]
2011-02-12 17:33:15 -05:00
Mike Bayer 33eae4a140 make it more explicit in tests which dialect we want to use for things 2011-02-11 11:24:54 -05:00
Mike Bayer 3f30fb065c - The compiler extension now supports overriding the default
compilation of expression._BindParamClause including that
the auto-generated binds within the VALUES/SET clause
of an insert()/update() statement will also use the new
compilation rules. [ticket:2042]
2011-02-09 15:45:15 -05:00
Mike Bayer c5b4938a9a - Fixed bug where "middle" class in a polymorphic hierarchy
would have no 'polymorphic_on' column if it didn't also
specify a 'polymorphic_identity', leading to strange
errors upon refresh, wrong class loaded when querying
from that target. [ticket:2038]
2011-02-02 18:10:07 -05:00
Mike Bayer de725a0a4d - Horizontal shard query places 'shard_id' in
context.attributes where it's accessible by the
"load()" event. [ticket:2031]
2011-01-23 17:03:19 -05:00