Commit Graph

238 Commits

Author SHA1 Message Date
Mike Bayer 0c19c1c66f - reorganize docs so expression, schema are broken out into subfiles, they're too big
- fix the targeting of module names moved around by using custom handlers for "Bases", etc.
2013-08-18 18:01:27 -04:00
Mike Bayer d102864609 - changelog
- clean up these tests to not use globals so much, close out the session
2013-08-17 00:20:46 -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 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
Matt Chisholm f499b7b883 Forgot final check that a delete in a backref also doesn't create a new version
follow up to https://bitbucket.org/zzzeek/sqlalchemy/pull-request/2
2013-06-17 23:30:07 +02:00
Matt Chisholm d6c60cb2f3 don't create a history entry when an object in a backref has changed
The code that determines whether an object in a relation has been added/removed does not take into account that that relation may be a backref. If the relation is a backref, then nothing on the current table is changing, and therefore no history entry should be created.
2013-06-15 18:15:29 +02:00
Mike Bayer 9fc6201f0c Merge branch 'master' into rel_0_9 2013-05-28 01:22:32 -04:00
Mike Bayer 94096593ca Fixed a small bug in the dogpile example where the generation
of SQL cache keys wasn't applying deduping labels to the
statement the same way :class:`.Query` normally does.
2013-05-28 01:22:10 -04:00
Mike Bayer 4b614b9b35 - the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
2013-04-27 19:53:57 -04:00
Mike Bayer 8cdb4543bd modernize some more examples 2013-04-27 17:21:31 -04:00
Mike Bayer b6bf8c2a30 Fixed a long-standing bug in the caching example, where
the limit/offset parameter values wouldn't be taken into
account when computing the cache key.  The
_key_from_query() function has been simplified to work
directly from the final compiled statement in order to get
at both the full statement as well as the fully processed
parameter list.
2013-04-18 20:11:08 -04:00
Mike Bayer 23c43e94b0 - remove erroneous second RelationshipCache class 2013-04-18 18:35:45 -04:00
Mike Bayer d7e4a85290 whack more long lines in very old docstrings 2013-02-02 18:54:54 -05:00
Mike Bayer 7f3cefeba8 Fixed a regression in the examples/dogpile_caching example
which was due to the change in #2614.
2013-01-08 10:59:26 -05:00
Diana Clarke f8caf05593 fixing InstrumentationManager links 2012-12-07 22:42:34 -05:00
Mike Bayer 39d17c76df - converted beaker demo to dogpile.cache, [ticket:2589] 2012-10-21 16:54:42 -04:00
Mike Bayer d2ed308da3 add a note 2012-08-17 19:11:21 -04:00
Mike Bayer 54824f50f8 - really start making postgis example slick. 2012-08-17 19:09:31 -04:00
Mike Bayer a2468c8a31 - [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level.   This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
2012-08-17 18:35:25 -04:00
Mike Bayer 20fa7fe2b8 - modernize most of the postgis example. would like to do [ticket:1534] also.
- we don't have coverage for type-wide instrumentation events, the listener was broke.
could break again too.
2012-08-16 22:20:53 -04:00
Mike Bayer 0aff01bdfd update the postgis example to actually work, using the old way (we'll update shortly) 2012-08-16 21:45:18 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer 27913554a8 trailing whitespace bonanza 2012-07-28 15:50:05 -04:00
Mike Bayer 319aa982a1 - [moved] The InstrumentationManager interface
and the entire related system of alternate
class implementation is now moved out
to sqlalchemy.ext.instrumentation.   This is
a seldom used system that adds significant
complexity and overhead to the mechanics of
class instrumentation.  The new architecture
allows it to remain unused until
InstrumentationManager is actually imported,
at which point it is bootstrapped into
the core.
2012-06-24 02:06:10 -04:00
Mike Bayer 2925167550 - [feature] The "deferred declarative
reflection" system has been moved into the
declarative extension itself, using the
new DeferredReflection class.  This
class is now tested with both single
and joined table inheritance use cases.
[ticket:2485]
- [bug] The autoload_replace flag on Table,
when False, will cause any reflected foreign key
constraints which refer to already-declared
columns to be skipped, assuming that the
in-Python declared column will take over
the task of specifying in-Python ForeignKey
or ForeignKeyConstraint declarations.
2012-05-17 11:45:05 -04:00
Mike Bayer cb3913a186 - [feature] New standalone function with_polymorphic()
provides the functionality of query.with_polymorphic()
in a standalone form.   It can be applied to any
entity within a query, including as the target
of a join in place of the "of_type()" modifier.
[ticket:2333]
- redo a large portion of the inheritance docs in terms
of declarative, new with_polymorphic() function
- upgrade examples/inheritance/polymorph, rename to "joined"
2012-04-23 22:17:25 -04:00
Mike Bayer c24a161530 - [bug] Altered _params_from_query() function
in Beaker example to pull bindparams from the
fully compiled statement, as a quick means
to get everything including subqueries in the
columns clause, etc.
2012-02-14 12:04:04 -05:00
Mike Bayer a925565f99 declarartive reflection example didn't actually work for single inheritance, added a tweak to make that possible 2012-02-09 15:56:21 -05:00
Mike Bayer 8e8e6a88b7 - [bug] Improved the "declarative reflection"
example to support single-table inheritance,
multiple calls to prepare(), tables that
are present in alternate schemas,
establishing only a subset of classes
as reflected.
2012-01-28 18:16:46 -05:00
Mike Bayer 84cb539e5f declarative reflection example 2012-01-28 17:41:10 -05:00
Mike Bayer 7e30b0ebd6 - [feature] New declarative reflection example
added, illustrates how best to mix table reflection
with declarative as well as uses some new features
from [ticket:2356].
2012-01-28 17:31:39 -05:00
Mike Bayer 007309015b modernize adjacency list example, use declarative 2012-01-28 17:22:04 -05:00
Mike Bayer c1ebdbdda2 fix a usage issue here 2012-01-28 17:09:27 -05:00
Mike Bayer b4da470d92 - [bug] Fixed large_collection.py to close the
session before dropping tables. [ticket:2346]
2012-01-22 19:21:51 -05:00
Mike Bayer 82e4bc2f52 - [feature] Simplified the versioning example
a bit to use a declarative mixin as well
as an event listener, instead of a metaclass +
SessionExtension.  [ticket:2313]
2012-01-22 19:03:06 -05:00
Mike Bayer 438e63db06 - Fixed bug in history_meta.py example where
the "unique" flag was not removed from a
single-table-inheritance subclass which
generates columns to put up onto the base.
2011-10-17 13:26:26 -04:00
Mike Bayer 1e6a2096e3 - Adjusted dictlike-polymorphic.py example
to apply the CAST such that it works on
    PG, other databases.  [ticket:2266]
2011-09-26 17:22:52 -04:00
Mike Bayer e4d9679ccf - Fixed the attribute shard example to check
for bind param callable correctly in 0.7
    style.
2011-06-26 13:00:58 -04:00
Mike Bayer e30d02c625 - Repaired the examples/versioning test runner
to not rely upon SQLAlchemy test libs,
nosetests must be run from within
examples/versioning to get around setup.cfg
breaking it.

- Tweak to examples/versioning to pick the
correct foreign key in a multi-level
inheritance situation.
2011-06-16 12:09:45 -04:00
Mike Bayer 621c497e54 update for new table model 2011-06-06 16:07:42 -04:00
Mike Bayer 46daefe5b0 update docs for generic associations 2011-04-28 12:33:30 -04:00
Mike Bayer d03226426c - removed the ancient "polymorphic association"
examples and replaced with an updated set of
examples that use declarative mixins,
"generic_associations".   Each presents an alternative
table layout.
2011-04-27 22:33:37 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer ff1868b3f0 - The horizontal_shard ShardedSession class accepts the common
Session argument "query_cls" as a constructor argument,
to enable further subclassing of ShardedQuery.
[ticket:2090]
- The Beaker caching example allows a "query_cls" argument
to the query_callable() function.  [ticket:2090]
2011-03-16 12:43:22 -04:00
Mike Bayer 8af45f93cb - Updated the association, association proxy examples
to use declarative, added a new example
dict_of_sets_with_default.py, a "pushing the envelope"
example of association proxy.
2011-03-13 13:59:00 -04:00
Mike Bayer 6458094024 - Beaker example now takes into account 'limit'
and 'offset', bind params within embedded
FROM clauses (like when you use union() or
from_self()) when generating a cache key.
2011-02-13 22:30:00 -05:00
Mike Bayer 3be8746527 add example usage for shard_id in context feature [ticket:2031] 2011-01-23 17:08:57 -05:00
Mike Bayer c9ebe3b723 - rename hybrid.property_, hybrid.method to hybrid_property, hybrid_method. more typing
on the import but this is just clearer.
- adapt dictlike-polymorphic.py to use hybrid.
2011-01-12 15:35:20 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00