Commit Graph

87 Commits

Author SHA1 Message Date
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
Mike Bayer ee99f8d58c new collections example 2006-12-12 21:42:13 +00:00
Mike Bayer 226baafe60 pickle example for dmiller 2006-12-09 00:09:14 +00:00
Mike Bayer 6d5786c1c2 docs/examples/unittests for remote_side 2006-12-08 20:50:48 +00:00
Mike Bayer 527626a19a patched **kwargs enhancement for [ticket:361] 2006-11-10 17:17:08 +00:00
Mike Bayer 695f65db85 - added an assertion within the "cascade" step of ORM relationships to check
that the class of object attached to a parent object is appropriate
(i.e. if A.items stores B objects, raise an error if a C is appended to A.items)
- new extension sqlalchemy.ext.associationproxy, provides transparent "association object"
mappings.  new example examples/association/proxied_association.py illustrates.
- some example cleanup
2006-11-03 01:17:28 +00:00
Mike Bayer 266f9f1ebe some example cleanup 2006-11-01 17:14:50 +00:00
Mike Bayer 256cdba4a0 added graphing example 2006-11-01 16:51:46 +00:00
Mike Bayer bc240be3f8 - attributes module and test suite moves underneath 'orm' package
- fixed table comparison example in metadata.txt
- docstrings all over the place
- renamed mapper _getattrbycolumn/_setattrbycolumn to get_attr_by_column,set_attr_by_column
- removed frommapper parameter from populate_instance().  the two operations can be performed separately
- fix to examples/adjacencytree/byroot_tree.py to fire off lazy loaders upon load, to reduce query calling
- added get(), get_by(), load() to MapperExtension
- re-implemented ExtensionOption (called by extension() function)
- redid _ExtensionCarrier to function dynamically based on __getattribute__
- added logging to attributes package, indicating the execution of a lazy callable
- going to close [ticket:329]
2006-10-22 00:24:26 +00:00
Mike Bayer 431149d542 tweak for Table.create() not having a return value 2006-10-21 22:38:40 +00:00
Mike Bayer 6f1eb443a3 - "custom list classes" is now implemented via the "collection_class"
keyword argument to relation().  the old way still works but is
    deprecated [ticket:212]
2006-10-03 23:38:48 +00:00
Mike Bayer d117a15020 - internal refactoring to mapper instances() method to use a
SelectionContext object to track state during the operation.
SLIGHT API BREAKAGE: the append_result() and populate_instances()
methods on MapperExtension have a slightly different method signature
now as a result of the change; hoping that these methods are not
in widespread use as of yet.
2006-09-30 04:40:15 +00:00
Mike Bayer c48177f0fe - unit-of-work does a better check for "orphaned" objects that are
part of a "delete-orphan" cascade, for certain conditions where the
parent isnt available to cascade from.
- it is now invalid to declare a self-referential relationship with
"delete-orphan" (as the abovementioned check would make them impossible
to save)
- improved the check for objects being part of a session when the
unit of work seeks to flush() them as part of a relationship..
2006-08-18 17:21:01 +00:00
Mike Bayer 8f2dddc171 echo=True 2006-07-18 15:13:32 +00:00
Mike Bayer 8005c15159 late compilation of mappers. now you can create mappers in any order, and they will compile their internal state when first used in a query or flush operation (or their props or 'c'/'columns' attributes are used). includes various cleanups and fixes in support of the change, including some unit test changes, additional unit tests. 2006-06-08 16:58:14 +00:00
Mike Bayer f8314ef9ff improvements/fixes to session cascade iteration,
fixes to entity_name propigation
2006-06-05 02:31:53 +00:00
Mike Bayer bb79e2e871 merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1 2006-05-25 14:20:23 +00:00
Mike Bayer dbf936c30b added explicit "session" argument to get(), select_whereclause in mapper, as well as throughout the call-chain for those. lazy loader honors the "session" of the parent object, + added simple unit test 2006-04-06 19:01:14 +00:00
Mike Bayer 787484945c put proper return type 2006-04-03 22:48:28 +00:00
Mike Bayer fcace31b88 improved translation of rows when proxying rows from one mapper to another. 2006-03-26 07:21:28 +00:00
Mike Bayer 69246aec95 a cool example that illustrates vertical table storage, and objects that automatically configure themselves for this type of storage 2006-03-26 06:30:21 +00:00
Mike Bayer 34d961cde0 got some support for mapping to a select that only selects some of the columns of an underlying table 2006-03-25 02:25:59 +00:00
Mike Bayer b1deaf1fb7 some more tweaks to get more advanced polymorphic stuff to work 2006-03-24 06:28:27 +00:00
Mike Bayer 865e2aaa19 a few tweaks and the polymorph example can also use eager loading 2006-03-20 01:16:16 +00:00
Mike Bayer 6bb1f8e701 got dilbert to be properly modified.... 2006-03-19 21:12:10 +00:00
Mike Bayer b5060e88ff added 'noninherited table' prop to mapper indicating the "lead" table, in the case of
inheritance.  relations now create priamry/secondary joins against that lead table.  if you want to create it against
an inherited table, use explicit join conditions.
added 'correlate' argument to CompoundSelect to get polymorph example working again.
2006-03-09 00:24:15 +00:00
Mike Bayer 55ad2dc22a added backref() function, allows the creation of a backref where you also send keyword arguments that will be placed on the relation 2006-03-07 03:14:08 +00:00