Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer 31ec1fc85e - add a clear() to SetIsh here so that the control/direct gets cleared
before we do the pop() test.
- make clear()/pop() test unconditional
2013-08-02 13:01:32 -04:00
Mike Bayer 4d132c38af Added a new attribute :attr:.Session.info to :class:.Session;
this is a dictionary where applications can store arbitrary
data local to a :class:`.Session`.
The contents of :attr:`.Session.info` can be also be initialized
using the ``info`` argument of :class:`.Session` or
:class:`.sessionmaker`.
2013-08-02 12:39:29 -04:00
Mike Bayer d2a6238372 - assorted fixes raised by pypy 2.1beta2, but all of which are good
ideas in general:
  - pypy2.1 w/ sqlite3 is the first DBAPI we're seeing returning
    unicode in cursor.description without being py3k.  add a new on-connect
    check for this, if we get back a u"", just don't do description decoding,
    should be OK for now.
  - the set tests in test_collection were assuming the two sets would be ordered
    the same when it tested pop(), can't really assume that.
  - test_serializer gets worse and worse, pickle is just not really viable here,
    ding out pypy
  - pypy2.1b2 seems to allow cursor.lastrowid to work (or we changed something?)
  - pool._threadconns.current() is a weakref, it can be None
  - another one of those logging.handlers imports
2013-08-01 20:25:56 -04:00
Mike Bayer 25839c064d Updates to MySQL reserved words for versions 5.5, 5.6, courtesy
Hanno Schlichting.  Also in 0.8.3, 0.7.11.
[ticket:2791]
2013-07-31 21:05:33 -04:00
Mike Bayer 5d4094ba73 fix missing comma 2013-07-31 19:07:13 -04:00
Mike Bayer c6fdfeed00 - update ORM event docs to include that you can listen on an unmapped base,
[ticket:2777]
2013-07-31 19:05:58 -04:00
Mike Bayer b27ee74f18 fix changelog 2013-07-31 18:50:16 -04:00
Mike Bayer 8b0f4d2a92 - Fixed bug in common table expression system where if the CTE were
used only as an ``alias()`` construct, it would not render using the
WITH keyword.  Also in 0.8.3, 0.7.11.
[ticket:2783]
2013-07-31 18:42:58 -04:00
Patrick R. Schmid 4e0a03fabd Made primary_key autoincrement=False in versioning example. 2013-07-31 17:12:40 -04:00
Mike Bayer 937c098d5a modernize this a bit 2013-07-27 19:12:40 -04:00
Mike Bayer effad0a4e3 - this collection can be None on cleanup, so check for that 2013-07-27 18:41:34 -04:00
Mike Bayer 20b7c03729 last updated 2013-07-27 18:38:40 -04:00
Mike Bayer 59675be673 try seeing if just clearing this ahead of time helps 2013-07-27 18:32:38 -04:00
Mike Bayer d64b09b15c - fix issue in join rewriting whereby we need to ensure the .key and .name
are transferred correctly for when .key is present; tests have been enhanced
to test this condition for render, result map construction, statement
execution.  [ticket:2790]
2013-07-27 17:05:01 -04:00
Mike Bayer a6adc0a53e - The C extensions are ported to Python 3 and will build under
any supported CPython 2 or 3 environment. [ticket:2161]
2013-07-26 20:50:18 -04:00
Mike Bayer c903f071a8 - add event.contains() function to the event package, returns True
if the given target/event/fn is set up to listen.
- repair mutable package which is doing some conditional event listening
2013-07-26 19:11:33 -04:00
Mike Bayer 4505425a38 - Removal of event listeners is now implemented. The feature is
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.
2013-07-26 14:21:58 -04:00
Mike Bayer 550141b14c - The mechanism by which attribute events pass along an
: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]
2013-07-26 00:01:04 -04:00
Mike Bayer e60c16c7e6 tpo 2013-07-20 00:41:10 -04:00
Mike Bayer af61551a11 - Improved the examples in `examples/generic_associations`, including
that ``discriminator_on_association.py`` makes use of single table
inheritance do the work with the "discriminator".  Also
added a true "generic foreign key" example, which works similarly
to other popular frameworks in that it uses an open-ended integer
to point to any other table, foregoing traditional referential
integrity.  While we don't recommend this pattern, information wants
to be free.  Also in 0.8.3.

- Added a convenience class decorator :func:`.as_declarative`, is
a wrapper for :func:`.declarative_base` which allows an existing base
class to be applied using a nifty class-decorated approach.  Also
in 0.8.3.
2013-07-19 22:56:34 -04:00
mike bayer 261b46d947 Merge pull request #18 from davidjb/patch-1
Minor hybrid extension documentation update
2013-07-19 08:37:27 -07:00
David Beitey f84d71fa3d Minor hybrid extension documentation update 2013-07-19 14:40:41 +10:00
Mike Bayer 9c6e45ff01 Fixed bug in ORM-level event registration where the "raw" or
"propagate" flags could potentially be mis-configured in some
"unmapped base class" configurations.  Also in 0.8.3.
[ticket:2786]
2013-07-18 23:17:33 -04:00
Mike Bayer 0a54a4a4b0 Fixed bug in :class:.CheckConstraint DDL where the "quote" flag from a
:class:`.Column` object would not be propagated.  Also in 0.8.3, 0.7.11.
[ticket:2784]
2013-07-17 11:18:59 -04:00
mike bayer c59199c987 Merge pull request #17 from iElectric/docs/wording_yield_per
wording about supported dialects for Query.yield_per
2013-07-14 09:58:43 -07:00
Domen Kožar 0d4b769d6a wording about supported dialects for Query.yield_per 2013-07-14 18:18:16 +02:00
Mike Bayer 171f8d4265 typo 2013-07-13 18:24:25 -04:00
Mike Bayer 5dbe771922 further tweaking 2013-07-13 16:41:16 -04:00
Mike Bayer c896c75971 fix the scoping here 2013-07-13 16:37:10 -04:00
Mike Bayer 040680a19c changelog for 0.9 2013-07-13 16:29:23 -04:00
Mike Bayer 731a4daf63 A performance fix related to the usage of the :func:.defer option
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]
2013-07-13 16:29:07 -04:00
Mike Bayer fd8b2d188c doc fix 2013-07-12 22:01:58 -04:00
Mike Bayer 63488b2d1e The newly added SQLite DATETIME arguments storage_format and
regexp apparently were not fully implemented correctly; while the
arguments were accepted, in practice they would have no effect;
this has been fixed.  Also in 0.8.3.
[ticket:2781]
2013-07-12 21:52:54 -04:00
Mike Bayer d08a6d291d - use inline=True for the insert..select here so it works on oracle 2013-07-12 12:14:50 -04:00
Mike Bayer 0abd571f6e CSS tweaks to support version styling in the latest versions of sphinx 2013-07-12 12:14:33 -04:00
Mike Bayer 0ca7b53b42 Fixed bug where the expression system relied upon the `str()`
form of a some expressions when referring to the ``.c`` collection
on a ``select()`` construct, but the ``str()`` form isn't available
since the element relies on dialect-specific compilation constructs,
notably the ``__getitem__()`` operator as used with a Postgresql
``ARRAY`` element.  The fix also adds a new exception class
:class:`.UnsupportedCompilationError` which is raised in those cases
where a compiler is asked to compile something it doesn't know
how to.  Also in 0.8.3.
[ticket:2780]
2013-07-12 11:32:34 -04:00
Mike Bayer 269a166b73 don't split the regexps for chop_traceback() 2013-07-12 10:42:53 -04:00
Mike Bayer fd55be01dd Dialect.initialize() is not called a second time if an :class:.Engine
is recreated, due to a disconnect error.   This fixes a particular
issue in the Oracle 8 dialect, but in general the dialect.initialize()
phase should only be once per dialect.  Also in 0.8.3. [ticket:2776]
2013-07-11 15:15:09 -04:00
Mike Bayer cd8a40284d - we dont actually need this unicode cast, on py3k + linux it seems the
has_table issues are OK.  On OSX forget it.
- still some issues with PY3k + pyodbc + decimal values it doesn't expect, not sure
2013-07-09 11:52:31 -04:00
Mike Bayer d5b18cb05b changelog for 2355 2013-07-09 11:33:55 -04:00
Mike Bayer 52107586fe callcounts 2013-07-08 14:02:46 -04:00
Mike Bayer 02a81707dc - create a new system where we can decorate an event method
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]
2013-07-08 13:39:56 -04:00
Mike Bayer db68ecff12 remove undoc-members from query docstring [ticket:2774] 2013-07-07 12:02:15 -04:00
Mike Bayer 71c47ac7ae use "target tables" here 2013-07-06 16:42:18 -04:00
Mike Bayer cec89cae15 - Added new method to the :func:.insert construct
:meth:`.Insert.from_select`.  Given a list of columns and
a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``.
While this feature is highlighted as part of 0.9 it is also
backported to 0.8.3. [ticket:722]
- The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs
will now interpret ORM entities as FROM clauses to be operated upon,
in the same way that select() already does.  Also in 0.8.3.
2013-07-05 15:51:24 -04:00
Mike Bayer 29ce6db26d 0.9 changelog 2013-07-04 20:03:18 -04:00
Mike Bayer 806f5a4183 Fixed bug whereby attribute history functions would fail
when an object we moved from "persistent" to "pending"
using the :func:`.make_transient` function, for operations
involving collection-based backrefs.
[ticket:2773]
2013-07-04 20:02:31 -04:00
Mike Bayer f390639bf1 Fixed bug where :class:.QueuePool would lose the correct
checked out count if an existing pooled connection failed to reconnect
after an invalidate or recycle event.  Also in 0.8.3.
[ticket:2772]
2013-07-04 13:18:00 -04:00
Mike Bayer 82f5ff7938 0.8.2 2013-07-03 16:19:07 -04:00
Mike Bayer f9ec82d22f dont need this 2013-07-03 15:38:26 -04:00