Commit Graph

492 Commits

Author SHA1 Message Date
Mike Bayer 334668d904 - added a new "higher level" operator called "of_type()" -
used in join() as well as with any() and has(), qualifies
the subclass which will be used in filter criterion,
e.g.:

query.filter(Company.employees.of_type(Engineer).
  any(Engineer.name=='foo')),

query.join(Company.employees.of_type(Engineer)).
  filter(Engineer.name=='foo')
2008-02-21 01:01:24 +00:00
Mike Bayer 85e8cb7ffb add pk cols to assocaition table 2008-02-12 16:45:39 +00:00
Mike Bayer 3ab7149e25 added info on foreign_keys attribute 2008-02-09 17:26:48 +00:00
Jason Kirtland 9bc19046d1 - clean up the print version of the docs a bit [ticket:745] 2008-02-06 01:32:33 +00:00
Jason Kirtland 28af2439d9 - doc edits- thanks asmodai! [ticket:906] 2008-02-05 20:26:08 +00:00
Mike Bayer 63d2ce5191 encourage usage of union() and other composites as module-level 2008-01-25 20:52:13 +00:00
Mike Bayer 29f7a38ee0 added an intro for the code sample so that its not construed as a "synopsis" 2008-01-23 20:00:53 +00:00
Mike Bayer ef63a84a49 further clarification on transaction state 2008-01-20 04:47:16 +00:00
Ants Aasma f645c0a420 example of using try-catch to do transaction commit/rollback was wrong in the docs 2008-01-20 03:39:43 +00:00
Ants Aasma 9f366afdda - parent transactions weren't started on the connection when adding a connection to a nested session transaction.
- session.transaction now always refers to the innermost active transaction, even when commit/rollback are called directly on the session transaction object.
- when preparing a two-phase transaction fails on one connection all the connections are rolled back.
- two phase transactions can now be prepared.
- session.close() didn't close all transactions when nested transactions were used.
- rollback() previously erroneously set the current transaction directly to the parent of the transaction that could be rolled back to.
- autoflush for commit() wasn't flushing for simple subtransactions.
2008-01-20 03:22:00 +00:00
Mike Bayer 02a4176a65 happy new year 2008-01-01 17:42:17 +00:00
Mike Bayer ba0267a955 introductory docstring bonanza 2007-12-18 23:53:40 +00:00
Mike Bayer f6068a3522 - select().as_scalar() will raise an exception if the select does not have
exactly one expression in its columns clause.
- added "helper exception" to select.type access, generic functions raise
the chance of this happening
- a slight behavioral change to attributes is, del'ing an attribute
does *not* cause the lazyloader of that attribute to fire off again;
the "del" makes the effective value of the attribute "None".  To
re-trigger the "loader" for an attribute, use
session.expire(instance, [attrname]).
- fix ormtutorial for IS NULL
2007-12-18 00:24:03 +00:00
Mike Bayer 7758edfd74 fix... 2007-12-09 18:27:01 +00:00
Mike Bayer acdb90784b - mutable primary key support is added. primary key columns can be
changed freely, and the identity of the instance will change upon
flush. In addition, update cascades of foreign key referents (primary
key or not) along relations are supported, either in tandem with the
database's ON UPDATE CASCADE (required for DB's like Postgres) or
issued directly by the ORM in the form of UPDATE statements, by setting
the flag "passive_cascades=False".
2007-12-09 05:00:12 +00:00
Mike Bayer c9b3f0bcef - added new methods to TypeDecorator, process_bind_param() and
process_result_value(), which automatically take advantage of the processing
of the underlying type.  Ideal for using with Unicode or Pickletype.
TypeDecorator should now be the primary way to augment the behavior of any
existing type including other TypeDecorator subclasses such as PickleType.
2007-12-08 23:03:22 +00:00
Mike Bayer 78bb82a44b changed the anonymous numbering scheme to be more appealing
got tests running
2007-12-08 18:38:18 +00:00
Mike Bayer 377a57ea8d corrected for current output... 2007-12-08 18:04:46 +00:00
Mike Bayer 88518c203d added a mention about eagerload_all() [ticket:897] 2007-12-08 17:07:40 +00:00
Mike Bayer 594784a206 assert_unicode=True replaced with default of assert_unicode='warn' 2007-12-05 22:21:37 +00:00
Mike Bayer 4ee7070223 new synonym() behavior, including auto-attribute gen, attribute decoration,
and auto-column mapping implemented; [ticket:801]
2007-11-28 21:13:35 +00:00
Mike Bayer d56e11ffe2 default value of assert_unicode is None on String, False on create_engine(), and True on Unicode type. 2007-11-28 00:44:16 +00:00
Mike Bayer 37bffd8f2b edits 2007-11-25 23:34:26 +00:00
Mike Bayer e4056a1787 - added new flag to String and create_engine(), assert_unicode=(True|False|None).
When convert_unicode=True, this flag also defaults to `True`, and results in all
unicode conversion operations raising an exception when a non-unicode bytestring
is passed as a bind parameter.  It is strongly advised that all unicode-aware
applications make proper use of Python unicode objects (i.e. u'hello' and
not 'hello').
2007-11-25 23:14:03 +00:00
Jason Kirtland 56d14df0eb Typo fix 2007-11-20 18:32:01 +00:00
Mike Bayer 051e43245d doctest fixups 2007-11-18 22:47:55 +00:00
Mike Bayer 622a26a655 - session.refresh() and session.expire() now support an additional argument
"attribute_names", a list of individual attribute keynames to be refreshed
or expired, allowing partial reloads of attributes on an already-loaded
instance.
- finally simplified the behavior of deferred attributes, deferred polymorphic
load, session.refresh, session.expire, mapper._postfetch to all use a single
codepath through query._get(), which now supports a list of individual attribute names
to be refreshed.  the *one* exception still remaining is mapper._get_poly_select_loader(),
which may stay that way since its inline with an already processing load operation.
otherwise, query._get() is the single place that all "load this instance's row" operation
proceeds.
- cleanup all over the place
2007-11-18 02:13:56 +00:00
Jason Kirtland df3cbebe3c Removed out of date identity map language (thanks, Jiten) 2007-11-10 15:47:19 +00:00
Mike Bayer 7a25be0f42 - identified some cases where Alias needs to be cloned; but still cant clone
when its an alias of a Table; added some test coverage for one particular
case from the doctests
- fixed "having" example in doctests, updated eager load example
2007-11-08 00:26:23 +00:00
Rick Morrison 5c060ab22a Added note about EXT_CONTINUE to 3.x -> 4.x migration guide 2007-11-05 22:52:21 +00:00
Rick Morrison 8dd51943a0 added small clarification on single-table inheritance mapper def 2007-11-03 16:11:41 +00:00
Mike Bayer 9cdc083ed1 doc updates for save_on_init=False, merge(...dont_save=True) 2007-11-02 21:02:22 +00:00
Mike Bayer 66cd772094 - merged factor_down_bindparams branch.
- removed ClauseParameters object; compiled.params returns a regular dictionary
  now, as well as result.last_inserted_params()/last_updated_params().
- various code trimming, method removals.
2007-11-01 03:58:21 +00:00
Mike Bayer ed2d7dc805 typos, PassiveDefault likes "text()" otherwise the argument is a literal 2007-10-17 19:10:16 +00:00
Mike Bayer cc41f0d3cf typo 2007-10-17 17:40:04 +00:00
Ants Aasma 6bbc7dd157 change the in_ API to accept a sequence or a selectable [ticket:750] 2007-10-16 22:57:05 +00:00
Jason Kirtland a54deba01d Typo fix (thanks Ben!) 2007-10-16 21:11:39 +00:00
Gaëtan de Menten dac7ab4a0f fix typo in examples 2007-10-15 08:51:23 +00:00
Mike Bayer f64768658d - much more query verbiage
- contains() operator doesn't need to generate negation criterion unless
many-to-many
2007-10-15 01:54:04 +00:00
Mike Bayer e57c94c64f documenting PropComparator behavior in orm tutorial 2007-10-14 20:34:39 +00:00
Jason Kirtland 224ff658e0 set svn:eol-style native 2007-10-13 20:35:42 +00:00
Mike Bayer e4d7b12c41 - doc updates. generated sql docs are against sql.expression now.
- added SessionExtension docs.
- removed old sqlconstruction doc.
- changed 'copy_collections' flag in Select to '_copy_collections'; its
not really "public".
2007-09-28 16:37:52 +00:00
Mike Bayer 475bfc04ac bump to beta7, but might become 0.4.0 2007-09-27 17:30:52 +00:00
Mike Bayer 5d93c8256b - some docstrings for select()
- fixed tutorial doctests to adjust for execution changes, session being weak-referencing
(reloads objects more frequently which get u'' applied to their __repr__())
2007-09-26 23:47:55 +00:00
Mike Bayer 32ee73460d add micro-doc for sequence standalone execution 2007-09-26 23:29:11 +00:00
Mike Bayer 6b0a907fbd - merged sa_entity branch. the big change here is the attributes system
deals primarily with the InstanceState and almost never with the instrumented object
directly.  This reduces lookups and complexity since we need the state for just about
everything, now its the one place for everything internally.
we also merged the new weak referencing identity map, which will go out in beta6 and
we'll see how that goes !
2007-09-22 16:55:36 +00:00
Mike Bayer da8d7c730c entity refs 2007-09-01 23:08:30 +00:00
Mike Bayer f6819fa9ae edits 2007-09-01 23:07:46 +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
Mike Bayer 69f7084c9b - merged inline inserts branch
- all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement
and don't do any pre-execution
- regular Insert and Update objects can have inline=True, forcing all executions to be inlined.
- no last_inserted_ids(), lastrow_has_defaults() available with inline execution
- calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified
- fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False
- fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc.
- all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all
insert/update/default functionality
2007-09-01 19:49:26 +00:00