Commit Graph

1750 Commits

Author SHA1 Message Date
Mike Bayer 8daa6ccfb0 - The `__mapper_args__` dictionary is copied from a declarative
mixin or abstract class when accessed, so that modifications made
to this dictionary by declarative itself won't conflict with that
of other mappings.  The dictionary is modified regarding the
``version_id_col`` and ``polymorphic_on`` arguments, replacing the
column within with the one that is officially mapped to the local
class/table. fixes #3062
2014-05-30 15:36:13 -04:00
Mike Bayer 2da30fde12 fix typo 2014-05-30 13:21:12 -04:00
Mike Bayer 56fa40e7f3 Merged in chrisw/sqlalchemy/more_range_docs (pull request #20)
more docs for using psycopg2 range types, specifically instantiating models with them

fixes #3046
2014-05-30 13:02:05 -04:00
Mike Bayer 2e4d3e65e3 - changelog + docs for pg8000 transaction isolation level 2014-05-30 12:27:42 -04:00
Mike Bayer 860b413ade - The psycopg2 `.closed` accessor is now consulted when determining
if an exception is a "disconnect" error; ideally, this should remove
the need for any other inspection of the exception message to detect
disconnect, however we will leave those existing messages in place
as a fallback.   This should be able to handle newer cases like
"SSL EOF" conditions.  Pull request courtesy Dirk Mueller.
fixes #3021
2014-05-30 11:56:19 -04:00
Mike Bayer 69dbcdd0eb - Related to 🎫3060, an adjustment has been made to the unit
of work such that loading for related many-to-one objects is slightly
more aggressive, in the case of a graph of self-referential objects
that are to be deleted; the load of related objects is to help
determine the correct order for deletion if passive_deletes is
not set.
- revert the changes to test_delete_unloaded_m2o, these deletes do in fact
need to occur in the order of the two child objects first.
2014-05-30 01:32:53 -04:00
Mike Bayer 1bd578998b add ticket 2014-05-29 19:57:03 -04:00
Mike Bayer 752f2e0fc8 - Adjustment to attribute mechanics concerning when a value is
implicitly initialized to None via first access; this action,
which has always resulted in a population of the attribute,
now emits an attribute event just like any other attribute set
operation and generates the same kind of history as one.  Additionally,
many mapper internal operations will no longer implicitly generate
these "None" values when various never-set attributes are checked.
These are subtle behavioral fixes to attribute mechanics which provide
a better solution to the problem of 🎫`3060`, which also
involves recognition of attributes explicitly set to ``None``
vs. attributes that were never set.
fixes #3061
2014-05-29 19:54:51 -04:00
Mike Bayer a04f0c1e37 relative here 2014-05-29 18:52:15 -04:00
Mike Bayer 6adaa66fbe - correct the size on side elements 2014-05-29 16:42:11 -04:00
Mike Bayer f07bc010ee - re-merge doc_nav. We've removed the whole idea of a "fixed top", and moved the
"fixed" thing entirely to the left side.  The content now regains full vertical real estate, such
that there's no workarounds needed for anchors, they work directly again.
we had to reorganize the whole layout to accommodate this however.
2014-05-29 15:54:13 -04:00
Mike Bayer 5d37a9377c fix 2014-05-29 15:49:04 -04:00
Mike Bayer 39e15ac760 more 2014-05-29 15:38:17 -04:00
Mike Bayer 686887688d - all new approach which allows the main text to be on the top 2014-05-29 15:26:31 -04:00
Mike Bayer b987f90cd0 - disable the scrolling layout, anchors for code/params are not working,
and the current approach used for sections is not able to work for fine-grained
anchors like these, another approach needs to be taken.
2014-05-29 12:28:19 -04:00
Mike Bayer bc08ee9029 - Fixed a few edge cases which arise in the so-called "row switch"
scenario, where an INSERT/DELETE can be turned into an UPDATE.
In this situation, a many-to-one relationship set to None, or
in some cases a scalar attribute set to None, may not be detected
as a net change in value, and therefore the UPDATE would not reset
what was on the previous row.   This is due to some as-yet
unresovled side effects of the way attribute history works in terms
of implicitly assuming None isn't really a "change" for a previously
un-set attribute.  See also 🎫`3061`. fixes #3060
2014-05-28 20:01:21 -04:00
Mike Bayer d60b680e96 - a rework of doc layout and nav:
- reduce the real estate for the top nav; move the search box
    into the top yellow box, close in space
  - use a new CSS/js approach such that the top toolbar freezes from
    scrolling at the top of the page.  The left nav scrolls independently
    of the content pane so that the local contents remain visible regardless
    of scrolling.   this approach is disabled on mobile where the dual scrollbars
    may be cumbersome (overall the site is not well designed for mobile).
2014-05-28 10:58:55 -04:00
Mike Bayer 5dfcf24b85 - add some more height here so that anchors come out 2014-05-27 19:06:30 -04:00
Mike Bayer bcb978d7b5 - disallow negative scroll positions from affecting the left nav position 2014-05-27 18:34:56 -04:00
Mike Bayer 70159e7551 - again use "fixed" for sidebar in all automated cases, dynamically
adjust its top within the initial scroll period, this is what foundationdb
is doing.   For whatever reason that comes out smooth on all browsers.
the rationale is so that its independently scrollable at all times.
2014-05-27 17:55:38 -04:00
Mike Bayer 59111c50c1 - go back to float:left for the sidenav in normal mode, we had a clear:right
causing the issue
2014-05-27 17:05:50 -04:00
Mike Bayer bb671fafca OK this one seems to be the most solid 2014-05-27 16:53:49 -04:00
Mike Bayer a0366c9a56 - use relative/absolute positioning and greatly simplify everything,
works in chrome + safari
2014-05-27 13:24:58 -04:00
Mike Bayer 2ce24b64e1 more tweaks 2014-05-26 16:40:24 -04:00
Mike Bayer e17ea5b3af - automate the offset part 2014-05-26 13:11:10 -04:00
Mike Bayer 2f878a47f8 - add mobile detection, turn the whole thing off if mobile 2014-05-26 12:37:48 -04:00
Mike Bayer 461bf43669 - pull in the whole top into the fixed part, reduce the size, clean it up 2014-05-26 12:31:43 -04:00
Mike Bayer 482a67e1c6 - Fixed bug in INSERT..FROM SELECT construct where selecting from a
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes #3044
2014-05-25 14:08:41 -04:00
Mike Bayer e384347ffb - Added the `hashable=False flag to the PG :class:.HSTORE` type, which
is needed to allow the ORM to skip over trying to "hash" an ORM-mapped
HSTORE column when requesting it in a mixed column/entity list.
Patch courtesy Gunnlaugur Þór Briem.  Fixes #3053
2014-05-25 13:58:08 -04:00
Mike Bayer 95b10c4e8e - Fixed bug in subquery eager loading where a long chain of
eager loads across a polymorphic-subclass boundary in conjunction
with polymorphic loading would fail to locate the subclass-link in the
chain, erroring out with a missing property name on an
:class:`.AliasedClass`. fixes #3055
2014-05-25 13:45:32 -04:00
Mike Bayer e6cbd88fe1 - Fixed bug in SQLite join rewriting where anonymized column names
due to repeats would not correctly be rewritten in subqueries.
This would affect SELECT queries with any kind of subquery + join.
fixes #3057
2014-05-25 11:32:07 -04:00
Chris Withers 551c730f3f more docs for using psycopg2 range types, specifically instantiating models with them 2014-05-25 15:46:31 +01:00
Mike Bayer b0b6f4295e - indicate all 0.9.5 issues as from 1.0.0 backported to 0.9.5 2014-05-24 15:15:00 -04:00
Mike Bayer d1705a46fe - Fixed bug where the :meth:.Operators.__and__,
:meth:`.Operators.__or__` and :meth:`.Operators.__invert__`
operator overload methods could not be overridden within a custom
:class:`.TypeEngine.Comparator` implementation.
fixes #3012
2014-05-24 14:35:28 -04:00
Mike Bayer 931685bac9 - hyperlink all the column operators listed in the ORM tutorial common filter operators section
- add language to MATCH explicitly stating this operator varies by backend and is not available
on SQLite, as the tutorial defaults to SQLite to start with, fix #3059
- on the actual match() documentation fix this up to be more accurate, list some example renderings
for different backends.  again mention SQLite not supported
2014-05-24 09:54:20 -04:00
Mike Bayer bc91884a41 - document the compiler_kwargs accessor
- add new FAQ for rendering SQL as a string
2014-05-23 14:26:22 -04:00
Mike Bayer 9c394ec1ae call this 1.0 2014-05-23 12:28:28 -04:00
Mike Bayer 0436538314 - changelog for #3034, at this point we can mark fix #3034 2014-05-23 11:34:14 -04:00
Mike Bayer 0932e16cb7 - switch master to be 1.0 2014-05-23 11:18:46 -04:00
Mike Bayer 460465a874 - changelog for #2785
- refactor tests a bit
fixes #2785
2014-05-16 13:09:50 -04:00
Mike Bayer 0f925ad430 typo 2014-05-16 12:59:47 -04:00
Mike Bayer 6212d59bdc - add lots more to the profiling section
- add the query profiling recipe, fix it with a stack as we now nest those
calls occasionally
- tabs to spaces
2014-05-16 11:53:12 -04:00
Mike Bayer aa12fdb40e - Fixed bug in mutable extension where :class:.MutableDict did not
report change events for the ``setdefault()`` dictionary operation.
fixes #3051
2014-05-14 10:03:24 -04:00
Mike Bayer 976b4c97df - add a new FAQ section "performance", put the profiling article there,
move the insert rows article there as well
2014-05-12 17:17:41 -04:00
Mike Bayer 46763173fc changelog for pullreq bitbucket:15 2014-05-12 11:39:49 -04:00
mike bayer 1abd53a355 Merge pull request #91 from smurfix/de_apostroph_ify
Documentation fix-up: "its" vs. "it's"
2014-05-11 13:04:05 -04:00
Matthias Urlichs f341cfbfe1 Documentation fix-up: "its" vs. "it's"
Removed ungrammatical apostrophes from documentation, replacing
"it's" with "its" where appropriate (but in a few cases with "it is"
when that read better).

While doing that, I also fixed a couple of minor typos etc.
as I noticed them.
2014-05-11 16:49:56 +02:00
Mike Bayer 230c0d5a19 - Fixed ORM bug where the :func:.class_mapper function would mask
AttributeErrors or KeyErrors that should raise during mapper
configuration due to user errors.  The catch for attribute/keyerror
has been made more specific to not include the configuration step.
fixes #3047
2014-05-10 23:26:09 -04:00
Mike Bayer 85d1899b76 - Fixed some "double invalidate" situations were detected where
a connection invalidation could occur within an already critical section
like a connection.close(); ultimately, these conditions are caused
by the change in 🎫`2907`, in that the "reset on return" feature
calls out to the Connection/Transaction in order to handle it, where
"disconnect detection" might be caught.  However, it's possible that
the more recent change in 🎫`2985` made it more likely for this
to be seen as the "connection invalidate" operation is much quicker,
as the issue is more reproducible on 0.9.4 than 0.9.3.

Checks are now added within any section that
an invalidate might occur to halt further disallowed operations
on the invalidated connection.  This includes two fixes both at the
engine level and at the pool level.   While the issue was observed
with highly concurrent gevent cases, it could in theory occur in
any kind of scenario where a disconnect occurs within the connection
close operation.
fixes #3043
ref #2985
ref #2907

- add some defensive checks during an invalidate situation:
1. _ConnectionRecord.invalidate might be called twice within finalize_fairy
if the _reset() raises an invalidate condition, invalidates, raises and then
goes to invalidate the CR.  so check for this.
2. similarly within Conneciton, anytime we do handle_dbapi_error(), we might become invalidated.
so a following finally must check self.__invalid before dealing with the connection
any futher.
2014-05-10 15:34:42 -04:00
Mike Bayer 55eacc8dbe - Fixed bug where :meth:.Table.update and :meth:.Table.delete
would produce an empty WHERE clause when an empty :func:`.and_()`
or :func:`.or_()` or other blank expression were applied.  This is
now consistent with that of :func:`.select`.
fixes #3045
2014-05-08 22:44:06 -04:00