summaryrefslogtreecommitdiff
path: root/examples/association
Commit message (Collapse)AuthorAgeFilesLines
* Try running pyupgrade on the codeFederico Caselli2022-11-161-1/+1
| | | | | | | | command run is "pyupgrade --py37-plus --keep-runtime-typing --keep-percent-format <files...>" pyupgrade will change assert_ to assertTrue. That was reverted since assertTrue does not exists in sqlalchemy fixtures Change-Id: Ie1ed2675c7b11d893d78e028aad0d1576baebb55
* rename MappedCollection and relatedMike Bayer2022-10-111-2/+2
| | | | | | | | | | | | | | | | | | For consistency with the prominent ORM concept :class:`_orm.Mapped`, the names of the dictionary-oriented collections, :func:`_orm.attribute_mapped_collection`, :func:`_orm.column_mapped_collection`, and :class:`_orm.MappedCollection`, are changed to :func:`_orm.attribute_keyed_dict`, :func:`_orm.column_keyed_dict` and :class:`_orm.KeyFuncDict`, using the phrase "dict" to minimize any confusion against the term "mapped". The old names will remain indefinitely with no schedule for removal. Docs here are also updated for typing as we can type these collections as ``Mapped[dict[str, cls]]``, don't need KeyFuncDict / MappedCollection for these Fixes: #8608 Change-Id: Ib5cf63e0aef1c389e023a75e454bb21f9d779b54
* Remove object in class definitionFederico Caselli2021-11-221-1/+1
| | | | | References: #4600 Change-Id: I2a62ddfe00bc562720f0eae700a497495d7a987a
* Post black reformattingMike Bayer2019-01-063-27/+33
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-063-61/+86
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* - fix formatting on examples to list the description first, some flake8Mike Bayer2018-12-073-9/+3
| | | | Change-Id: I57144a559f20abab02e745d052be5ff84edec7f8
* fix pep8 errors in association examplePaul Brown2017-03-184-20/+33
| | | | (cherry picked from commit 6aad7fb4217ef294f68f693be5b3137c28184949)
* - add a new sphinx extension "viewsource". takes advantage of part of the ↵Mike Bayer2013-11-094-17/+18
| | | | | | | | | 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.
* - the raw 2to3 runMike Bayer2013-04-273-10/+10
| | | | - went through examples/ and cleaned out excess list() calls
* modernize some more examplesMike Bayer2013-04-272-3/+3
|
* -whitespace bonanza, contdMike Bayer2012-07-283-4/+4
|
* - Updated the association, association proxy examplesMike Bayer2011-03-134-187/+255
| | | | | | to use declarative, added a new example dict_of_sets_with_default.py, a "pushing the envelope" example of association proxy.
* - whitespace removal bonanzaMike Bayer2011-01-021-2/+2
|
* - remove remaining create_session() calls from examples, replace with SessionMike Bayer2010-10-242-12/+8
| | | | - replace all flush()/expunge_all() with commit()
* fix some examplesMike Bayer2010-03-282-2/+2
|
* - converted all lazy=True|False|None to 'select'|'joined'|'noload'Mike Bayer2010-03-242-3/+3
| | | | | - converted all eager to joined in examples - fixed beaker/advanced.py to reference RelationshipCache
* - The official name for the relation() function is nowMike Bayer2010-03-172-6/+6
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* - mega example cleanupMike Bayer2010-01-191-0/+25
| | | | | | - added READMEs to all examples in each __init__.py and added to sphinx documentation - added versioning example - removed vertical/vertical.py, the dictlikes are more straightforward
* Added in Examples into the test suite so they get exercised regularly. ↵Michael Trier2009-07-271-0/+0
| | | | Cleaned up some deprecation warnings in the examples.
* Lots of fixes to the code examples to specify imports explicitly.Michael Trier2009-03-312-12/+14
| | | | | | | Explicit imports make it easier for users to understand the examples. Additionally a lot of the examples were fixed to work with the changes in the 0.5.x code base. One small correction to the Case expression. Thanks a bunch to Adam Lowry! Fixes #717.
* synchronize inherited does not need to be called for the full mapper hierarchyMike Bayer2008-09-051-5/+6
|
* Applied .append(x, **kw) removal patch from [ticket:1124] and general cleanup.Jason Kirtland2008-08-151-49/+36
|
* - got all examples workingMike Bayer2007-09-011-4/+5
| | | | | | | - inline default execution occurs for *all* non-PK columns unconditionally - preexecute only for non-executemany PK cols on PG, Oracle, etc. - new default docs
* Association example updates, round two.Jason Kirtland2007-08-221-10/+15
|
* basic 0.4 updateJason Kirtland2007-08-221-28/+26
|
* - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData insteadJason Kirtland2007-07-062-2/+2
| | | | | - Deprecated BoundMetaData- use MetaData instead - Removed DMD and BMD from documentation
* - Query has add_entity() and add_column() generative methods. theseMike Bayer2007-03-101-2/+2
| | | | | | | | | will add the given mapper/class or ColumnElement to the query at compile time, and apply them to the instances method. the user is responsible for constructing reasonable join conditions (otherwise you can get full cartesian products). result set is the list of tuples, non-uniqued. - fixed multi-mapper instances() to pad out shorter results with None so zip() gets everything
* patched **kwargs enhancement for [ticket:361]Mike Bayer2006-11-101-1/+8
|
* - added an assertion within the "cascade" step of ORM relationships to checkMike Bayer2006-11-032-0/+212
that the class of object attached to a parent object is appropriate (i.e. if A.items stores B objects, raise an error if a C is appended to A.items) - new extension sqlalchemy.ext.associationproxy, provides transparent "association object" mappings. new example examples/association/proxied_association.py illustrates. - some example cleanup