summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* mapping multiple tables for one classpr/20biner2013-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm doing something to finish the horizontal shard job. The examle is sharding to multiple database . And i just do it for multipls tables in one database. there is many tables just like msg_00,msg_01..... msg_99 defind the class like Msg() map the tables . =============================== m = Msg number = int(uid)%100 tablename = 'msg_%02d'%(number) m.__uuid__ = uid m.__table__.name = tablename =============================== now "m" mapping the table msg_xx . It works in the select sql. but fail in the session.add(newmessage) because the sqlalchemy has cache connection . event one table is Table(msg_00) and another is Table (msg_01) So, i edit the memo key . then there is diff insert object . ------------------ It's simple change and useful. It‘s safe for the old version . sorry for my poor english.
* - update ORM event docs to include that you can listen on an unmapped base,Mike Bayer2013-07-311-29/+32
| | | | [ticket:2777]
* - Removal of event listeners is now implemented. The feature isMike Bayer2013-07-262-53/+58
| | | | | | | | | | | | | | | | provided via the :func:`.event.remove` function. [ticket:2268] - reorganization of event.py module into a package; with the addition of the docstring work as well as the new registry for removal, there's a lot more code now. the package separates concerns and provides a top-level doc for each subsection of functionality - the remove feature works by providing the EventKey object which associates the user-provided arguments to listen() with a global, weak-referencing registry. This registry stores a collection of _ListenerCollection and _DispatchDescriptor objects associated with each set of arguments, as well as the wrapped function which was applied to that collection. The EventKey can then be recreated for a removal, all the _ListenerCollection and _DispatchDescriptor objects are located, and the correct wrapped function is removed from each one.
* - The mechanism by which attribute events pass along anMike Bayer2013-07-263-52/+123
| | | | | | | | | | | | | | | | | | | :class:`.AttributeImpl` as an "initiator" token has been changed; the object is now an event-specific object called :class:`.attributes.Event`. Additionally, the attribute system no longer halts events based on a matching "initiator" token; this logic has been moved to be specific to ORM backref event handlers, which are the typical source of the re-propagation of an attribute event onto subsequent append/set/remove operations. End user code which emulates the behavior of backrefs must now ensure that recursive event propagation schemes are halted, if the scheme does not use the backref handlers. Using this new system, backref handlers can now peform a "two-hop" operation when an object is appended to a collection, associated with a new many-to-one, de-associated with the previous many-to-one, and then removed from a previous collection. Before this change, the last step of removal from the previous collection would not occur. [ticket:2789]
* Fixed bug in ORM-level event registration where the "raw" orMike Bayer2013-07-181-5/+8
| | | | | | "propagate" flags could potentially be mis-configured in some "unmapped base class" configurations. Also in 0.8.3. [ticket:2786]
* wording about supported dialects for Query.yield_perpr/17Domen Kožar2013-07-141-6/+6
|
* A performance fix related to the usage of the :func:`.defer` optionMike Bayer2013-07-134-32/+38
| | | | | | | | | | | | | when loading mapped entities. The function overhead of applying a per-object deferred callable to an instance at load time was significantly higher than that of just loading the data from the row (note that ``defer()`` is meant to reduce DB/network overhead, not necessarily function call count); the function call overhead is now less than that of loading data from the column in all cases. There is also a reduction in the number of "lazy callable" objects created per load from N (total deferred values in the result) to 1 (total number of deferred cols). [ticket:2778]
* - create a new system where we can decorate an event methodMike Bayer2013-07-082-18/+56
| | | | | | | | | | | | | | | | with @_legacy_signature, will inspect incoming listener functions to see if they match an older signature, will wrap into a newer sig - add an event listen argument named=True, will send all args as kw args so that event listeners can be written with **kw, any combination of names - add a doc system to events that writes out the various calling styles for a given event, produces deprecation messages automatically. a little concerned that it's a bit verbose but will look at it up on RTD for awhile to get a feel. - change the calling signature for bulk update/delete events - we have the BulkUD object right there, and there's at least six or seven things people might want to see, so just send the whole BulkUD in [ticket:2775]
* remove undoc-members from query docstring [ticket:2774]Mike Bayer2013-07-071-0/+7
|
* Fixed bug whereby attribute history functions would failMike Bayer2013-07-041-2/+2
| | | | | | | when an object we moved from "persistent" to "pending" using the :func:`.make_transient` function, for operations involving collection-based backrefs. [ticket:2773]
* - additional fix for [ticket:2750] where on an update, we make sure theMike Bayer2013-06-301-1/+2
| | | | value is present
* A warning is emitted when trying to flush an object of an inheritedMike Bayer2013-06-302-1/+35
| | | | | mapped class where the polymorphic discriminator has been assigned to a value that is invalid for the class. [ticket:2750]
* - fix a regression caused by #2587, where query.join() would apply anMike Bayer2013-06-271-1/+1
| | | | | adapter to an aliased-mapped, non-polymorphic selectable that prevented us from referring directly to that selectable.
* remove double methodsMike Bayer2013-06-171-19/+0
|
* - rework PropComparator.adapted() to be PropComparator.adapt_to_entity(),Mike Bayer2013-06-175-120/+137
| | | | | | | passes in AliasedInsp and allows more flexibility. - rework the AliasedClass/AliasedInsp relationship so that AliasedInsp has all state and functionality. AliasedClass is just a facade. [ticket:2756]
* Fixed bug in polymorphic SQL generation where multiple joined-inheritanceMike Bayer2013-06-151-5/+10
| | | | | | | entities against the same base class joined to each other as well would not track columns on the base table independently of each other if the string of joins were more than two entities long. Also in 0.8.2. [ticket:2759]
* Fixed bug where sending a composite attribute into :meth:`.Query.order_by`Mike Bayer2013-06-101-1/+1
| | | | | would produce a parenthesized expression not accepted by some databases. [ticket:2754]
* Fixed the interaction between composite attributes andMike Bayer2013-06-102-15/+24
| | | | | | the :func:`.aliased` function. Previously, composite attributes wouldn't work correctly in comparison operations when aliasing was applied. Also in 0.8.2. [ticket:2755]
* - tests for the alias() APIMike Bayer2013-06-081-0/+26
| | | | - docs docs docs
* - Fixed an obscure bug where the wrong results would beMike Bayer2013-06-071-2/+7
| | | | | | | | | | | fetched when joining/joinedloading across a many-to-many relationship to a single-table-inheriting subclass with a specific discriminator value, due to "secondary" rows that would come back. The "secondary" and right-side tables are now inner joined inside of parenthesis for all ORM joins on many-to-many relationships so that the left->right join can accurately filtered. [ticket:2369]
* remove all remaining start/end py2k/py3k blocksMike Bayer2013-06-072-14/+10
|
* dial back the default "flatness" a bit, it will be there for joinedload and ↵Mike Bayer2013-06-064-13/+23
| | | | | | | query.join(), but if you're dealing with aliased() or with_polymorphic() you need to say "flat=True". Just the one flag though, "flat" implies "aliased".
* shrugsMike Bayer2013-06-051-1/+6
|
* a test for what's breaking, plus a non-working fix for it...Mike Bayer2013-06-051-0/+3
|
* - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-042-23/+17
| | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
* - eager loadsMike Bayer2013-06-042-3/+2
| | | | - two suite of SQL assertions converted
* here's the flat join thing. it just works. Changing the existing compiled ↵Mike Bayer2013-06-042-3/+5
| | | | | | SQL assertions might even be most of the tests we need (though dedicated sql tests would be needed anyway)
* rewriting scheme now works.Mike Bayer2013-06-041-6/+3
|
* OK this is the broken version, need to think a lot more about thisMike Bayer2013-06-031-2/+2
|
* - pulling out more aliases, sort ofMike Bayer2013-06-031-4/+9
|
* working through tests....Mike Bayer2013-06-021-5/+21
|
* - figured out what the from_self() thing was about, part of query.statement, ↵Mike Bayer2013-06-021-0/+2
| | | | | | but would like to improve upon query.statement needing to do this
* getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-021-8/+8
| | | | | | step when we do query.count() are showing
* - blow away context._attributesMike Bayer2013-06-024-40/+44
| | | | | - to account for query._attributes/context.attributes, just pass the attributes dict directly to the PathRegistry methods
* Fixed a regression caused by [ticket:2682] whereby theMike Bayer2013-05-311-0/+6
| | | | | | | evaluation invoked by :meth:`.Query.update` and :meth:`.Query.delete` would hit upon unsupported ``True`` and ``False`` symbols which now appear due to the usage of ``IS``. [ticket:2737]
* The "auto-aliasing" behavior of the :class:`.Query.select_from`Mike Bayer2013-05-302-12/+131
| | | | | | method has been turned off. The specific behavior is now availble via a new method :class:`.Query.select_entity_from`. [ticket:2736]
* Merge branch 'rel_0_9'Mike Bayer2013-05-2917-161/+154
|\ | | | | | | | | | | | | Conflicts: lib/sqlalchemy/dialects/postgresql/hstore.py lib/sqlalchemy/util/__init__.py lib/sqlalchemy/util/compat.py
| * clean up some of this collection stuffMike Bayer2013-05-261-2/+1
| |
| * a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-267-16/+16
| | | | | | | | as possible
| * do a sweep of some obvious 3kismsMike Bayer2013-05-261-25/+21
| |
| * repair py3kisms in key ORM modulesMike Bayer2013-05-263-22/+22
| |
| * merge defaultMike Bayer2013-05-131-1/+8
| |\
| * \ merge defaultMike Bayer2013-05-101-20/+53
| |\ \
| * | | most of ORM passing...Mike Bayer2013-05-045-40/+32
| | | |
| * | | merge defaultMike Bayer2013-04-301-3/+4
| |\ \ \
| * | | | import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-273-7/+5
| | | | |
| * | | | - the raw 2to3 runMike Bayer2013-04-2718-172/+180
| | | | | | | | | | | | | | | | | | | | - went through examples/ and cleaned out excess list() calls
* | | | | - move an import stuck in the middle here...Mike Bayer2013-05-281-1/+1
| |_|_|/ |/| | |
* | | | Fixed a regression from 0.7 caused by this ticket, whichMike Bayer2013-05-131-1/+8
| |_|/ |/| | | | | | | | | | | | | | | | | | | | made the check for recursion overflow in self-referential eager joining too loose, missing a particular circumstance where a subclass had lazy="joined" or "subquery" configured and the load was a "with_polymorphic" against the base. [ticket:2481]
* | | - moderinzed the docs for the foreign_keys parameter a bit,Mike Bayer2013-05-101-20/+53
| |/ |/| | | | | [ticket:2725]