Commit Graph

212 Commits

Author SHA1 Message Date
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
Mike Bayer 426c4356eb - removes the "on_" prefix. 2010-12-30 14:22:43 -05:00
Mike Bayer b1c90de449 - mutable examples now move into sqlalchemy.ext.mutable
- streamline interfaces, get Mutable/MutableComposite to be as minimal
in usage as possible
- docs for mutable, warnings regrarding mapper events being global
- move MutableType/mutable=True outwards, move orm tests to its
own module, note in all documentation
- still need more events/tests for correct pickling support of
composites, mutables.  in the case of composites its needed
even without mutation.  see [ticket:2009]
2010-12-29 15:04:35 -05:00
Mike Bayer 3b41b66981 - restore mapper.get_property() to use the _props dict. at the moment
synonyms for relationships might just be taken out altogether, since they aren't
documented and are of little use.   a plain proxying descriptor, combined with
attribute-based usage with Query (as opposted to naming it by string)
 can do the same thing more simply.
- add event support to composites, change the model around so that the composite
is generated at the point of load.
- add a recipe for tracking mutations on composites.  will probably make both
of these mutations examples into extensions since they're intricate, should
have a lot of test coverage, and what they need to do is fairly straightforward.
Will use metaclasses so that no extra userland step is needed beyond usage
of the type.
2010-12-28 22:23:13 -05:00
Mike Bayer bfbc0a08f6 - link to the events we use 2010-12-26 17:32:41 -05:00
Mike Bayer 2e58059cbb - docs for mutable events example 2010-12-26 17:28:56 -05:00
Mike Bayer 9c7b004559 - add a new "on mapper configured" event - handy ! 2010-12-25 13:22:12 -05:00
Mike Bayer 6cd730541f - restore declarative support for "composite"
- add an example of mutable scalars with events
2010-12-23 15:27:47 -05:00
Mike Bayer 993af53204 - fix beaker caching example to use new ".callable" param on bind 2010-12-22 11:37:07 -05:00
Mike Bayer 09534eaf9a - merge versioning example fix from 0.6 2010-12-20 10:51:24 -05:00
Mike Bayer 1c67cf5caf - gently push users towards entity name for simple cases 2010-12-07 23:11:47 -05:00
Mike Bayer d30678d18d new calling style: event.listen(target, identifier, fn) 2010-12-01 14:10:11 -05:00
Mike Bayer 61840abbce - NullPool is now used by default for SQLite file-
based databases.  :memory: databases will continue
 to select SingletonThreadPool by default.
 [ticket:1921]
2010-11-28 12:00:01 -05:00
Mike Bayer f1e4718f79 - merge mapper simpler compile branch, [ticket:1966] 2010-11-26 16:28:41 -05:00
Mike Bayer c5442b3adb - merge hybrid attributes branch, [ticket:1903] 2010-11-20 12:55:46 -05:00
Mike Bayer 20ad3b16e8 [ticket:1966] implementation 2010-11-15 19:05:23 -05:00
Mike Bayer f252af2b21 merge tip 2010-11-14 17:54:47 -05:00
Mike Bayer 4e2c0f10cd - merge tip 2010-11-06 11:49:45 -04:00
Mike Bayer bfc0977063 - remove remaining create_session() calls from examples, replace with Session
- replace all flush()/expunge_all() with commit()
2010-10-24 12:42:47 -04:00
Mike Bayer d46985d699 - add instrumentation events
- simplify listen_for_events example with new system
- add "propagate", "retval", "raw" flags to attribute events.  this solves the "return value"
issue as well as the "subclass" issue.
- begin thinking about event removal.   Each listen() method will have a corresponding remove().
Custom listen() methods will have to package all the info onto the event function that is needed
to remove its state.
2010-10-02 13:31:07 -04:00
Mike Bayer 25c08f6def merge tip 2010-10-02 11:00:22 -04:00
Mike Bayer 25a04d87c3 - optimized_al doesn't need mapper extension
- convert to non-bound metadata, Session, session.commit()
2010-09-24 11:11:12 -04:00
Mike Bayer 3d389b19b7 - reorganization
- attrbutes.py splits into attribtes.py and instrumentation.py
- all the various Event subclasses go into events.py modules
- some ideas for orm events
- move *Extension out to deprecated_interfaces
2010-09-14 20:43:48 -04:00
Mike Bayer 9d7158a2c3 merge tip 2010-09-14 17:46:54 -04:00
Mike Bayer bc26030e6f - the versioning example works correctly now
if versioning on a col that was formerly
    NULL.
2010-09-05 14:51:00 -04:00
Mike Bayer 7217711f46 - mapper _get_col_to_prop private method used
by the versioning example is deprecated;
now use mapper.get_property_by_column() which
will remain the public method for this.
- turned TODO in the history example into an assertion
with a descriptive reason
2010-09-05 11:28:43 -04:00
Mike Bayer 904466a293 merge latest tip 2010-09-03 18:01:59 -04:00