Commit Graph

324 Commits

Author SHA1 Message Date
Mike Bayer 741b8af31b - convert ORM tutorial and basic_relationships to favor
back_populates while still maintaining great familiarity
w/ backref so as not to confuse people.  fixes #3390
2015-12-10 18:27:14 -05:00
Mike Bayer d533b8e922 - The ORM and Core tutorials, which have always been in doctest format,
are now exercised within the normal unit test suite in both Python
2 and Python 3.
- remove the old testdocs.py runner and replace with test/base/test_tutorials.py
- use pytest's unicode fixer so that we can test for unicode strings
in both py2k/3k
- use py3k format overall for prints, exceptions
- add other fixers to guarantee deterministic results
- add skips and ellipses to outputs that aren't worth matching
2015-12-10 17:09:47 -05:00
Mike Bayer 38e043a475 Merge remote-tracking branch 'origin/pr/214' 2015-11-30 12:53:56 -05:00
Mike Bayer 1dc805dd4d - add documentation that describes, then proceeds to warn about
the many caveats and confusing effects of, the popular approach
of using contains_eager() to alter the natural result of a
related collection.  I'm not a fan of this technique as it changes
the semantics of a relationship in such a way that the rest of the
ORM isn't aware of and it also can be undone very easily; hence the
section needs as much text for warnings as for describing the
technique itself.   fixes #3563
2015-11-19 15:24:22 -05:00
Mike Bayer c7f9aa2818 - rewrite the docs and add a test for the bake_queries=True
relationship flag; this flag *does* have an effect when the baked
lazy loader plugin has been invoked.  clarify the intent of this
flag as an "opt out" but only has an effect when the baked system
is loaded anyway.  fixes #3572
2015-11-19 14:23:08 -05:00
Jeff Widman 11e190ef07 Fix typo: wtihin --> within 2015-11-16 18:47:29 -08:00
Mike Bayer 5d8bb1f4a6 - fix ambiguous documentation re: after_flush_postexec(), the
looping nature of it only occurs within the context of a commit.
2015-11-09 16:48:58 -05:00
Mike Bayer 9d08c6abc2 - Added the :paramref:.AssociationProxy.info parameter to the
:class:`.AssociationProxy` constructor, to suit the
:attr:`.AssociationProxy.info` accessor that was added in
🎫`2971`.  This is possible because :class:`.AssociationProxy`
is constructed explicitly, unlike a hybrid which is constructed
implicitly via the decorator syntax.
fixes #3551
2015-10-09 18:01:43 -04:00
Mike Bayer d84dea62de - add an additional note regarding select_from, fixes #3546 2015-10-02 11:23:50 -04:00
Mike Bayer ac08920284 - remove ambiguous use of the phrase "joined together by AND" as this
may be construed as the Python "and" keyword
- add notes to ORM tutorial for beginners that Python "and" keyword
is not to be used
fixes #3545
2015-10-01 09:38:22 -04:00
Eric Siegerman a9b5fb3f49 Add Query.one_or_none() 2015-09-24 13:22:45 -04:00
Mike Bayer 80aeba3d5e - Added a new type-level modifier :meth:.TypeEngine.evaluates_none
which indicates to the ORM that a positive set of None should be
persisted as the value NULL, instead of omitting the column from
the INSERT statement.  This feature is used both as part of the
implementation for 🎫`3514` as well as a standalone feature
available on any type.  fixes #3250
- add new documentation section illustrating the "how to force null"
 use case of #3250
- alter our change from #3514 so that the class-level flag is now
called "should_evaluate_none"; so that "evaluates_none" is now
a generative method.
2015-09-19 16:27:51 -04:00
Mike Bayer 7eb34baf99 - fix incorrect example in inheritance docs 2015-09-15 11:17:13 -04:00
Mike Bayer f5b13797a6 Merged in bsmithgall/sqlalchemy/event-doc-link-fix (pull request #60)
fix typo in session events docs
2015-09-08 18:10:51 -04:00
mike bayer 74781d8532 Merge pull request #197 from davidjb/master
Minor grammar fix for capitalisation in session docs
2015-09-08 18:09:06 -04:00
bsmithgall 2fb3bb31ef fix typo in session events docs 2015-09-07 21:37:19 -04:00
Mike Bayer 176ac6ab09 - update moved link, fixes #3351 2015-09-03 16:42:43 -04:00
Mike Bayer 108c60f460 - The :class:.SessionEvents suite now includes events to allow
unambiguous tracking of all object lifecycle state transitions
in terms of the :class:`.Session` itself, e.g. pending,
transient,  persistent, detached.   The state of the object
within each event is also defined.
fixes #2677
- Added a new session lifecycle state :term:`deleted`.  This new state
represents an object that has been deleted from the :term:`persistent`
state and will move to the :term:`detached` state once the transaction
is committed.  This resolves the long-standing issue that objects
which were deleted existed in a gray area between persistent and
detached.   The :attr:`.InstanceState.persistent` accessor will
**no longer** report on a deleted object as persistent; the
:attr:`.InstanceState.deleted` accessor will instead be True for
these objects, until they become detached.
- The :paramref:`.Session.weak_identity_map` parameter is deprecated.
See the new recipe at :ref:`session_referencing_behavior` for
an event-based approach to maintaining strong identity map behavior.
references #3517
2015-09-02 17:55:15 -04:00
Mike Bayer 8be93c23ee - add new documentation that applies to all modern SQLA versions,
detailing ORM event recipes across the board.
2015-09-02 11:58:59 -04:00
David\ Beitey 3bd58fac7b Minor grammar fix for capitalisation in session docs 2015-08-28 13:57:54 +10:00
Mike Bayer 956907a4b1 - use consistent and descriptive language in all cases
where we refer to the "weak_identity_map" option, and add additional
exposition in the session documentation which refers to it.
fixes #3517
2015-08-27 23:38:14 -04:00
Mike Bayer d459afa8db - reword and update documentation on passive_updates=False; as virtually
all DBs now support ON UPDATE CASCADE other than Oracle, there's no need
to try to reimplement more functionality here and users should be encouraged
to forego natural PKs unless their target platform supports them.
references #2666
2015-08-27 15:56:00 -04:00
Mike Bayer 4f51fa947f - work to bridge between core/ORM tutorials regarding the text() construct 2015-07-26 16:36:23 -04:00
Mike Bayer 7d268d4bcb - remove "completely raw", whatever that is 2015-07-26 16:29:30 -04:00
Mike Bayer 2997d3910d - typo 2015-07-26 16:22:35 -04:00
Mike Bayer d73ffaafe6 - add an example of text.columns
- correct the scalar() example output
2015-07-26 16:09:25 -04:00
Mike Bayer 3180f15837 - Organize the tree for 1.1 2015-07-24 18:27:45 -04:00
Mike Bayer cf21497f02 - fix the link here fixes 3473 2015-07-03 12:16:07 -04:00
Mike Bayer 00656ae493 - edits to this section 2015-06-22 22:24:07 -04:00
Mike Bayer be2b35f7f2 - add a new FAQ on re-reading of data within a transaction, since
this is definitely something that is asked regularly.
2015-06-22 21:33:40 -04:00
Mike Bayer 8f1130672d - add a comment, also I think we want to expire before we do the
new begin, as begin_nested() does a flush
2015-06-09 12:20:07 -04:00
Charles-Axel Dein d1dc39d55d Expire session in testing transaction handling 2015-06-08 10:01:59 -07:00
Éric Araujo 6245d003f2 Fix typo in directive 2015-05-29 15:21:16 -04:00
Pierre Rochard 9434356da6 Correcting typo in introspection 2015-05-17 17:28:56 -04:00
Ernest Walzel a518b31f3b Fix typos
agaisnt -> against
'a Alias' -> 'an Alias'
2015-03-26 18:28:11 +00:00
Mike Bayer 4077e99f3f - tweaks regarding the use_alter update 2015-03-13 16:22:01 -04:00
Mike Bayer 941fe5e060 - add the fact that we can cache the sql naively as well 2015-03-12 12:19:35 -04:00
Mike Bayer 6b76352f46 - add a rationale section 2015-03-12 11:23:44 -04:00
Mike Bayer e3b46bd624 - Added a new extension suite :mod:sqlalchemy.ext.baked. This
simple but unusual system allows for a dramatic savings in Python
overhead for the construction and processing of orm :class:`.Query`
objects, from query construction up through rendering of a string
SQL statement.
fixes #3054
2015-03-11 20:31:11 -04:00
Mike Bayer 710021d22e - Added a new event suite :class:.QueryEvents. The
:meth:`.QueryEvents.before_compile` event allows the creation
of functions which may place additional modifications to
:class:`.Query` objects before the construction of the SELECT
statement.   It is hoped that this event be made much more
useful via the advent of a new inspection system that will
allow for detailed modifications to be made against
:class:`.Query` objects in an automated fashion.
fixes #3317
2015-03-10 19:56:59 -04:00
Mike Bayer 9cbe235810 - A warning is emitted if the `isolation_level` parameter is used
with :meth:`.Connection.execution_options` when a :class:`.Transaction`
is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2,
MySQLdb may implicitly rollback or commit the transaction, or
not change the setting til next transaction, so this is never safe.
- Added new parameter :paramref:`.Session.connection.execution_options`
which may be used to set up execution options on a :class:`.Connection`
when it is first checked out, before the transaction has begun.
This is used to set up options such as isolation level on the
connection before the transaction starts.
- added new documentation section
detailing best practices for setting transaction isolation with
sessions.
fixes #3296
2015-02-04 18:35:01 -05:00
Mike Bayer 8aaa8dd6bd - fix link to non_primary flag
- rewrite the multiple mappers section
2015-01-27 00:34:10 -05:00
Mike Bayer 41307cd733 - add new section to ORM referring to runtime inspection API,
more links, attempt to fix #3290
2015-01-14 12:02:41 -05:00
Mike Bayer 1104dcaa67 - add MemoizedSlots, a generalized solution to using __getattr__
for memoization on a class that uses slots.
- apply many more __slots__.  mem use for nova now at 46% savings
2015-01-05 19:02:08 -05:00
Mike Bayer 41ae0270d9 - make a new page that introduces mapping a little better for the
"mapping" section, contrasts declarative and classical some more
2015-01-05 14:20:03 -05:00
Mike Bayer 0bd632804e - fix links for loading, add a redirect page
bump

foo
2014-12-27 19:52:44 -05:00
Mike Bayer 31e2fe75d9 - remove private superclasses from docs in favor of fixing
zzzeeksphinx to omit these from warning

Conflicts:
	doc/build/orm/internals.rst
2014-12-27 17:46:55 -05:00
Mike Bayer 5343d24fee corrections 2014-12-27 16:54:32 -05:00
Mike Bayer 544e72bcb6 - corrections
- attempt to add a script to semi-automate the fixing of links
2014-12-27 16:22:41 -05:00
Mike Bayer b92589e3a0 - create a new section on "custom load rules", to help with edge
cases like that of #3277.  fixes #3277
2014-12-19 11:55:10 -05:00