Commit Graph

113 Commits

Author SHA1 Message Date
Mike Bayer a5dfbeedb9 - Improved the behavior of aliased() objects such that they more
accurately adapt the expressions generated, which helps
particularly with self-referential comparisons. [ticket:1171]

- Fixed bug involving primaryjoin/secondaryjoin conditions
constructed from class-bound attributes (as often occurs
when using declarative), which later would be inappropriately
aliased by Query, particularly with the various EXISTS
based comparators.
2008-11-03 02:52:30 +00:00
Mike Bayer baa9006c28 remove erroneous comments 2008-10-24 19:43:29 +00:00
Mike Bayer eba763b258 two more cache examples 2008-10-24 19:41:25 +00:00
Mike Bayer 16dd8aab74 "nested sets" example. needs work. 2008-09-18 22:14:29 +00:00
Mike Bayer 0fbb67b71a synchronize inherited does not need to be called for the full mapper hierarchy 2008-09-05 15:23:44 +00:00
Mike Bayer 3829b89d69 - column_property(), composite_property(), and relation() now
accept a single or list of AttributeExtensions using the
"extension" keyword argument.
- Added a Validator AttributeExtension, as well as a
@validates decorator which is used in a similar fashion
as @reconstructor, and marks a method as validating
one or more mapped attributes.
- removed validate_attributes example, the new methodology replaces it
2008-09-02 19:51:48 +00:00
Mike Bayer 3e25e6e6b0 - AttributeListener has been refined such that the event
is fired before the mutation actually occurs.  Addtionally,
the append() and set() methods must now return the given value,
which is used as the value to be used in the mutation operation.
This allows creation of validating AttributeListeners which
raise before the action actually occurs, and which can change
the given value into something else before its used.
A new example "validate_attributes.py" shows one such recipe
for doing this.   AttributeListener helper functions are
also on the way.
2008-09-02 17:57:35 +00:00
Mike Bayer 4c6c996f9b - add an example illustrating attribute event reception. 2008-08-29 16:15:41 +00:00
Jason Kirtland 05ac1efe0d Applied .append(x, **kw) removal patch from [ticket:1124] and general cleanup. 2008-08-15 23:33:43 +00:00
Mike Bayer cc87685c93 removing this example until further notice (append_result() not an easy road to travel) 2008-08-15 22:57:14 +00:00
Mike Bayer 01bce5c129 fix adjacency list examples 2008-07-14 19:44:37 +00:00
Gaëtan de Menten b2edf4a0fd typo 2008-07-11 07:39:21 +00:00
Gaëtan de Menten 7ade777df2 update poly_assoc examples for 0.4+ syntax 2008-07-03 13:19:31 +00:00
Mike Bayer 8755dc3d66 - fixed up vertical.py
- Fixed query.join() when used in conjunction with a
columns-only clause and an SQL-expression
ON clause in the join.
2008-06-28 15:23:08 +00:00
Mike Bayer 3cd10102e4 - Query.UpdateDeleteTest.test_delete_fallback fails on mysql due to subquery in DELETE; not sure how to do this exact operation in MySQL
- added query_cls keyword argument to sessionmaker(); allows user-defined Query subclasses to be generated by query().
- added @attributes.on_reconstitute decorator, MapperExtension.on_reconstitute, both receieve 'on_load' attribute event allowing
non-__init__ dependent instance initialization routines.
- push memusage to the top to avoid pointless heisenbugs
- renamed '_foostate'/'_fooclass_manager' to '_sa_instance_state'/'_sa_class_manager'
- removed legacy instance ORM state accessors
- query._get() will use _remove_newly_deleted instead of expunge() on ObjectDeleted, so that transaction rollback
restores the previous state
- removed MapperExtension.get(); replaced by a user-defined Query subclass
- removed needless **kwargs from query.get()
- removed Session.get(cls, id); this is redundant against Session.query(cls).get(id)
- removed Query.load() and Session.load(); the use case for this method has never been clear, and the same functionality is available in more explicit ways
2008-06-09 01:24:08 +00:00
Mike Bayer 86ded90c6e make Query._clone() class-agnostic 2008-06-02 15:32:17 +00:00
Mike Bayer c998539b40 illustrates a simple Query "hook" to implement query caching. 2008-06-02 15:27:38 +00:00
Mike Bayer 4a6afd469f r4695 merged to trunk; trunk now becomes 0.5.
0.4 development continues at /sqlalchemy/branches/rel_0_4
2008-05-09 16:34:10 +00:00
Mike Bayer 30f55a5016 - added an example dynamic_dict/dynamic_dict.py, illustrating
a simple way to place dictionary behavior on top of
a dynamic_loader.
2008-05-07 14:48:04 +00:00
Jason Kirtland c37ed5cbb3 - Added comparable_property(), adds query Comparator behavior to regular, unmanaged Python properties
- Some aspects of MapperProperty initialization are streteched pretty thin now
  and need a refactor; will proceed with these on the user_defined_state branch
2008-03-17 22:06:49 +00:00
Jason Kirtland adc929c0f1 - Added two new vertical dict mapping examples. 2008-02-12 01:44:20 +00:00
Mike Bayer 8cf05355bb oof...unicode object still needs to return the value if it just warned... 2007-12-14 23:47:33 +00:00
Mike Bayer 379d333c31 oof, history on collections were wrong. fixed byroot_tree test as well 2007-12-14 23:28:10 +00:00
Mike Bayer 9629838f7d - fixed wrong varname in session exception throw
- fixed vertical example to just use a scoped session
2007-12-05 20:55:33 +00:00
Jason Kirtland 7f0b5edc92 Removed some distractions, ala r3770. 2007-11-14 01:26:50 +00:00
Jason Kirtland f4a9e4512b Removed some distractions. 2007-11-14 00:43:49 +00:00
Mike Bayer fc753a0647 - fixes to ShardedSession to work with deferred columns [ticket:771].
- user-defined shard_chooser() function must accept "clause=None"
  argument; this is the ClauseElement passed to session.execute(statement)
  and can be used to determine correct shard id (since execute() doesn't
  take an instance)
2007-09-08 19:51:35 +00:00
Mike Bayer 5df1759e15 - got all examples working
- inline default execution occurs for *all* non-PK columns
unconditionally - preexecute only for non-executemany PK cols on
PG, Oracle, etc.
- new default docs
2007-09-01 21:21:29 +00:00
Jason Kirtland d80751ceb3 Association example updates, round two. 2007-08-22 04:20:14 +00:00
Jason Kirtland 6ccb0f9f57 basic 0.4 update 2007-08-22 03:25:09 +00:00
Jason Kirtland 0051349d09 Updated adjencytree examples 2007-08-21 21:05:23 +00:00
Mike Bayer 820346549b - modified SQL operator functions to be module-level operators, allowing
SQL expressions to be pickleable [ticket:735]

- small adjustment to mapper class.__init__ to allow for Py2.6 object.__init__()
  behavior
2007-08-18 01:00:44 +00:00
Mike Bayer f6306cc604 needed orm import 2007-08-16 15:20:20 +00:00
Mike Bayer b01c63280e #725 add query arg to id_chooser() 2007-08-10 21:18:01 +00:00
Mike Bayer d3971e8a3a - added hooks for alternate session classes into sessionmaker
- moved shard example/unittest over to sessionmaker
2007-08-03 19:54:16 +00:00
Mike Bayer b9a7fc23da small fix for filter() aliasing, upgraded elementtree examples to use 0.4 style queries 2007-08-03 18:47:35 +00:00
Jason Kirtland 18dab5baf0 Added EXT_CONTINUE and EXT_STOP for MapperExtensions; EXT_PASS is a synonym for EXT_CONTINUE.
Repointed docs and examples to EXT_CONTINUE
2007-08-01 07:18:50 +00:00
Mike Bayer 5b7363c338 - merged ants' derived attributes example from 0.4 branch
- disabled PG schema test for now (want to see the buildbot succeed)
2007-07-27 04:12:07 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Jason Kirtland 177d30cc01 - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData instead
- Deprecated BoundMetaData- use MetaData instead
- Removed DMD and BMD from documentation
2007-07-06 00:58:09 +00:00
Mike Bayer bee542f9f7 added proper cascade for deletes 2007-06-30 01:16:39 +00:00
Mike Bayer 7bb67e363d fix to "populate_existing" 2007-06-27 23:12:08 +00:00
Mike Bayer 4302d162ae documented eager load fix 2007-06-08 14:24:10 +00:00
Mike Bayer 4215a5f200 - eager loader calls select_mapper so that poly rulesets get picked up
- changed polymorph example to use a single set of outerjoins
2007-06-08 03:17:11 +00:00
Mike Bayer c5a63b7dbf some updates 2007-05-29 23:56:10 +00:00
Mike Bayer 4e109aa21e fix to the backref primary join condition 2007-05-29 04:08:09 +00:00
Mike Bayer 18f7d1f024 added "polymorphic assocaition" example, illustrates how to emulate
Rails' polymorphic associaiton functionality
2007-05-28 23:41:44 +00:00
Mike Bayer 8d7a271b86 docs/examples for new with_parent() feature 2007-04-17 18:15:58 +00:00
Mike Bayer dc2d085a75 - Query has add_entity() and add_column() generative methods. these
will add the given mapper/class or ColumnElement to the query at compile
time, and apply them to the instances method.  the user is responsible
for constructing reasonable join conditions (otherwise you can get
full cartesian products).  result set is the list of tuples, non-uniqued.
- fixed multi-mapper instances() to pad out shorter results with None so
zip() gets everything
2007-03-10 03:41:55 +00:00
Mike Bayer 99924c8645 docs: [ticket:345], [ticket:356], [ticket:48], [ticket:403], [ticket:394],
cleanup/completion of keyword arg documentation for create_engine(), mapper(), and
relation()
2007-01-21 00:09:25 +00:00