Commit Graph

253 Commits

Author SHA1 Message Date
Mike Bayer 4588a0e603 - use column.info to detect those cols part of "versioning"
- pep8 cleanup
- fix tests for "changed" column
- document that "changed" is optional
- changelog
2014-02-16 16:38:09 -05:00
Mike Bayer 4dd7bf58c0 Merge branch 'patch-1' of https://github.com/jplaverdure/sqlalchemy into t 2014-02-16 16:23:54 -05:00
Mike Bayer b85f0b5681 - Added a tweak to the "history_meta" example where the check for
"history" on a relationship-bound attribute will now no longer emit
any SQL if the relationship is unloaded.
2014-02-02 19:05:36 -05:00
Mike Bayer d7da0dfb7a specify run as module here 2013-12-07 17:37:36 -05:00
Mike Bayer 5517c0eef9 - remove verbiage about "namespaces" from the dogpile example, [ticket:2862]
- fix broken py2k/py3k isms
2013-12-07 17:33:13 -05:00
Mike Bayer 3a03c2e715 - add a new example section for "join conditions", start putting
the primaryjoin examples there
2013-12-05 12:17:16 -05:00
Mike Bayer d80ee72aaa - the pronoun removal commit. there was only one instance of a
standalone gendered pronoun with a gender-neutral subject, but also
have replaced all occurences of "his/her", "his or her", etc.  The docs have always
strived to account for both genders in any non-specific singular pronoun,
however recent controversy in the community suggests
that a zero-gendered-pronoun policy is probably best going forward.
2013-11-30 17:31:00 -05:00
Mike Bayer 53e93d50ca forgot to add this, oopsie 2013-11-30 10:34:09 -05:00
Mike Bayer 1714e0d6ef simplify this 2013-11-30 10:26:11 -05:00
Mike Bayer 58fab1be98 - start reworking examples to include more code from the wiki.
- add the other versioning examples from the wiki
- modernize the dictlike examples
2013-11-29 18:53:53 -05:00
Mike Bayer 546015e6e1 - add a new sphinx extension "viewsource". takes advantage of part of the viewcode extension
to allow ad-hoc display of the source of any file, as well as a "directory listing" structure.
- reorganize examples/ to take advantage of new extension.  in particular, keep moving all
the descriptive text for files etc. into module docstrings, taking more advantage of
self-documentation.
2013-11-09 19:42:01 -05:00
Mike Bayer ac54ba0f2d - add proof of concept for versioning, [ticket:2861] 2013-11-08 18:19:41 -05:00
jplaverdure acbe8a9ac3 Switched to UTC Timestamp 2013-11-08 16:11:54 -05:00
jplaverdure 9927b84516 Added changed(timestamp) on _history table and supprot for schemas 2013-11-08 11:58:35 -05:00
Mike Bayer 29a07fc09a - Fixed bug which prevented history_meta recipe from working with
joined inheritance schemes more than one level deep.
- don't need to use _lib.py here anymore now that these features are in
sqlalchemy.testing
2013-11-07 20:35:24 -05:00
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