Commit Graph

413 Commits

Author SHA1 Message Date
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
Mike Bayer dc7d611182 - tests for hybrid
- documentation for hybrid
- rewrite descriptor, synonym, comparable_property documentation
2011-01-17 20:05:09 -05:00
Mike Bayer 8ca1e58032 - oracle fixes 2011-01-15 19:50:01 -05:00
Mike Bayer 4f18ce0af5 - add support for pickling with mutable scalars, mutable composites
- add pickle/unpickle events to ORM events.  these are needed
for the mutable extension.
- finish mutable extension documentation, consolidate examples,
add full descriptions
2011-01-02 19:54:31 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 6d36d4635c - add length to varchars 2010-12-31 11:47:38 -05:00
Mike Bayer 426c4356eb - removes the "on_" prefix. 2010-12-30 14:22:43 -05:00
Mike Bayer 7f7bccfc83 - they don't want "on_". First step, change the naming convention on Events
so that non-events are just _name.
2010-12-30 13:43:39 -05:00
Mike Bayer b1c90de449 - mutable examples now move into sqlalchemy.ext.mutable
- streamline interfaces, get Mutable/MutableComposite to be as minimal
in usage as possible
- docs for mutable, warnings regrarding mapper events being global
- move MutableType/mutable=True outwards, move orm tests to its
own module, note in all documentation
- still need more events/tests for correct pickling support of
composites, mutables.  in the case of composites its needed
even without mutation.  see [ticket:2009]
2010-12-29 15:04:35 -05:00
Mike Bayer 73f2b37fc9 - remove OrderedSet usage from a critical area 2010-12-22 19:07:04 -05:00
Mike Bayer f1e54a69fb - merge default tip 2010-12-05 14:56:26 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 61840abbce - NullPool is now used by default for SQLite file-
based databases.  :memory: databases will continue
 to select SingletonThreadPool by default.
 [ticket:1921]
2010-11-28 12:00:01 -05:00
Mike Bayer ee25562461 - merge 2-arg form of query.join(), [ticket:1923] 2010-11-26 16:40:41 -05:00
Mike Bayer f1e4718f79 - merge mapper simpler compile branch, [ticket:1966] 2010-11-26 16:28:41 -05:00