summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext
Commit message (Collapse)AuthorAgeFilesLines
* - Merged 0.5's declarative behavior such that allMike Bayer2008-07-091-0/+3
| | | | | | | Column and MapperProperty objects keep a state variable indicating their creation order, which declarative_base() maintains when generating Table constructs.
* back-merged current 0.4 trunk into rel_0_4 branch, which will become the 0.4 ↵Mike Bayer2008-05-098-224/+762
| | | | maintenance branch
* Really finish proxied list methods. Either these last couple (count, remove, ↵Jason Kirtland2007-07-251-5/+56
| | | | | | setitem w/ slice) weren't possible in 0.3 and/or I spaced these. Improved messaging on flubbed stepped slice assignment in collection decorators.
* add __repr__ for engine, metadata, sqlsoupJonathan Ellis2007-07-251-0/+3
|
* - deprecated scalar=True argument on select(). its replacedMike Bayer2007-07-241-5/+3
| | | | | | | | | | by select().scalar() which returns a _ScalarSelect object, that obeys the ColumnElement interface fully - removed _selectable() method. replaced with __selectable__() as an optional duck-typer; subclassing Selectable (without any __selectable__()) is equivalent - query._col_aggregate() was assuming bound metadata. ick ! - probably should deprecate ClauseElement.scalar(), in favor of ClauseElement.execute().scalar()... otherwise might need to rename select().scalar()
* dont clobber existing methodnames, [ticket:596]Mike Bayer2007-07-201-2/+5
|
* changed assignmapper API per [ticket:636]Mike Bayer2007-07-201-30/+26
|
* Remove unused imports, typo and light formatting tweaks.Jason Kirtland2007-07-192-4/+2
| | | | Fixed comparison of _UnaryExpressions
* .pop() on association proxies is no longer problematic with 0.4 collections.Jason Kirtland2007-07-181-0/+3
|
* removed some remaining "connectable"/"bind_to" keywordsMike Bayer2007-07-161-2/+2
|
* - merged trunk r2880-r2901 (slightly manually for 2900-2901)Mike Bayer2007-07-141-2/+3
| | | | | | - merges "bind" argument change - merges join fixes for [ticket:185] - removed all "engine"/"connectable"/"bind_to"/"engine_or_url" arguments/attributes
* - renamed DynamicMetaData to ThreadLocalMetaDataJason Kirtland2007-07-062-4/+4
| | | | - removed BoundMetaData, use MetaData instead
* Fix up extensions in wake of r2852 mapper.props changeJason Kirtland2007-07-052-6/+7
|
* - added NullType to export listMike Bayer2007-07-031-1/+1
| | | | | | | - any NullType will trigger the "get col type from FK logic", though there are other issues with this logic (requires the FK be initialized) - added INT to sqlite resolution map - adjusted sqlsoup for sql.Select api changes
* Unused import.Jason Kirtland2007-06-281-1/+0
|
* - Replaced collection api: The "InstrumentedList" proxy is replaced withJason Kirtland2007-06-271-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a proxy-free, decorator-based approach for user-space instrumentation and a "view" adapter for interaction with the user's collection within the orm. Fixes [ticket:213], [ticket:548], [ticket:563]. - This needs many more unit tests. There is significant indirect coverage through association proxy, but direct tests are needed, specifically in the decorators and add/remove event firing. - Collections are now instrumented via decorations rather than proxying. You can now have collections that manage their own membership, and your class instance will be directly exposed on the relation property. The changes are transparent for most users. - InstrumentedList (as it was) is removed, and relation properties no longer have 'clear()', '.data', or any other added methods beyond those provided by the collection type. You are free, of course, to add them to a custom class. - __setitem__-like assignments now fire remove events for the existing value, if any. - dict-likes used as collection classes no longer need to change __iter__ semantics- itervalues() is used by default instead. This is a backwards incompatible change. - subclassing dict for a mapped collection is no longer needed in most cases. orm.collections provides canned implementations that key objects by a specified column or a custom function of your choice. - collection assignment now requires a compatible type- assigning None to clear a collection or assinging a list to a dict collection will now raise an argument error. - AttributeExtension moved to interfaces, and .delete is now .remove The event method signature has also been swapped around.
* merged trunk r2755-r2778Mike Bayer2007-06-241-1/+1
|
* - merge of generative_sql branchMike Bayer2007-06-241-1/+1
| | | | | | | | | | | | | | | | | | | - copy_container() removed. ClauseVisitor.traverse() now features "clone" flag which allows traversal with copy-and-modify-in-place behavior - select() objects copyable now [ticket:52] [ticket:569] - improved support for custom column_property() attributes which feature correlated subqueries...work better with eager loading now. - accept_visitor() methods removed. ClauseVisitor now genererates method names based on class names, or an optional __visit_name__ attribute. calls regular visit_XXX methods as they exist, can optionally call an additional "pre-descent" enter_XXX method to allow stack-based operations on traversals - select() and union()'s now have "generative" behavior. methods like order_by() and group_by() return a *new* instance - the original instance is left unchanged. non-generative methods remain as well. - the internals of select/union vastly simplified - all decision making regarding "is subquery" and "correlation" pushed to SQL generation phase. select() elements are now *never* mutated by their enclosing containers or by any dialect's compilation process
* - Added missing orm importJason Kirtland2007-06-221-2/+2
|
* - merged trunk r2730-r2755Mike Bayer2007-06-201-1/+1
| | | | - removed "clear_mapper()" method
* - merged trunk 2629-2730Mike Bayer2007-06-142-23/+48
| | | | | - fixes to is_select() which is now an important method - mysql unit tests fixes
* merge 2684-2686 from trunkJonathan Ellis2007-06-121-12/+28
|
* - moved another chunk of mapper.py tests to query.py test suiteMike Bayer2007-06-054-318/+22
| | | | | | | - got all tests/extensions working with new APIs - axed proxyengine until further notice - SelectResults folds into a 10 line wrapper for Query, loses join_to() (use join()) - test cleanup
* - interfaces lib in docstringsMike Bayer2007-06-041-1/+1
| | | | | - query.join() resets the joinpoint - added filter(), filter_by() to assignmapper
* - removed cascade_mappers(). long overdue.Mike Bayer2007-06-022-3/+3
| | | | | | | - removed sqlalchemy.orm from sqlalchemy.__init__ namespace. still needs updates in documentation, tutorial pages - moved MapperExtension to interfaces package - moved ExtensionCarrier to orm.util
* - most of the __init__ decoration has been removed from mapper, save forMike Bayer2007-05-272-7/+26
| | | | | | | | | that the mappers all get compiled when an instance of a mapped class is first constructed. the SessionContextExt extension gets all the "add object to the session" logic now and the _sa_session and _sa_entity_name arguments only apply to when the SessionContextExt is in use. Some extra methods to MapperExtension to support __init__ decoration. - assignmapper loses "join_to", gains "join". id like to replace all those methods with just "query" but i think they are too popular, so it should probably get filter(), filter_by() also.
* Oops, Python 2.5 ternary operator snuck in.Jason Kirtland2007-05-031-3/+12
|
* - Test assoc proxy lazy loads, fixed __set__ race on single scalar assocsJason Kirtland2007-05-031-1/+6
|
* - New association proxy implementation, implementing complete proxies to ↵Jason Kirtland2007-05-031-80/+584
| | | | | | list, dict and set-based relation collections (and scalar relations). Extensive tests. - Added util.duck_type_collection
* - added sqlalchemy.ext.orderinglist, a custom list class that synchronizes ↵Jason Kirtland2007-05-021-0/+181
| | | | an object attribute with that object's position in the list
* - small fix to SelectResultsExt to not bypass itself duringMike Bayer2007-04-301-1/+1
| | | | select().
* correct typo-equivalent mistakes in some comments/docstringsGaëtan de Menten2007-04-271-1/+1
|
* wrap __name__ settings in a try/except for 2.3 compatMike Bayer2007-04-251-2/+8
|
* - assign_mapper names methods according to their keys (i.e. __name__)Mike Bayer2007-04-241-0/+2
| | | | #551
* - big fix to AssociationProxy so that multiple AssociationProxyMike Bayer2007-04-231-2/+3
| | | | objects can be associated with a single association collection.
* - column label and bind param "truncation" also generateMike Bayer2007-03-281-2/+2
| | | | | | | | | | | deterministic names now, based on their ordering within the full statement being compiled. this means the same statement will produce the same string across application restarts and allowing DB query plan caching to work better. - cleanup to sql.ClauseParameters since it was just falling apart, API made more explicit - many unit test tweaks to adjust for bind params not being "pre" truncated, changes to ClauseParameters
* integrated docutils formatting into generated documentation;Mike Bayer2007-03-171-4/+5
| | | | restructuredtext fixes throughout docstrings
* - the full featureset of the SelectResults extension has been mergedMike Bayer2007-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into a new set of methods available off of Query. These methods all provide "generative" behavior, whereby the Query is copied and a new one returned with additional criterion added. The new methods include: filter() - applies select criterion to the query filter_by() - applies "by"-style criterion to the query avg() - return the avg() function on the given column join() - join to a property (or across a list of properties) outerjoin() - like join() but uses LEFT OUTER JOIN limit()/offset() - apply LIMIT/OFFSET range-based access which applies limit/offset: session.query(Foo)[3:5] distinct() - apply DISTINCT list() - evaluate the criterion and return results no incompatible changes have been made to Query's API and no methods have been deprecated. Existing methods like select(), select_by(), get(), get_by() all execute the query at once and return results like they always did. join_to()/join_via() are still there although the generative join()/outerjoin() methods are easier to use. - the return value for multiple mappers used with instances() now returns a cartesian product of the requested list of mappers, represented as a list of tuples. this corresponds to the documented behavior. So that instances match up properly, the "uniquing" is disabled when this feature is used. - strings and columns can also be sent to the *args of instances() where those exact result columns will be part of the result tuples. - query() method is added by assignmapper. this helps with navigating to all the new generative methods on Query.
* - options() method on SelectResults now implemented "generatively"Mike Bayer2007-03-071-2/+4
| | | | like the rest of the SelectResults methods [ticket:472]
* migrated (most) docstrings to pep-257 format, docstring generator using ↵Mike Bayer2007-02-255-187/+314
| | | | | | straight <pre> + trim() func for now. applies most of [ticket:214], compliemnts of Lele Gaifax
* - added selectfirst(), selectfirst_by() to assign_mapper [ticket:467]Mike Bayer2007-02-221-1/+1
|
* - added options() method to SelectResults, equivalent to query.options() ↵Mike Bayer2007-02-101-0/+8
| | | | [ticket:472]
* - implemented foreign_keys argument on relation() [ticket:385]Mike Bayer2007-02-101-1/+1
| | | | | | | - PropertyLoader figures out accurate remote_side collection based on foreign_keys, legacy foreignkey, primary/secondaryjoin/polymorphic - reworked lazyloader, sync to work straight off foreign_keys/ remote_side collections
* - added optional __table_opts__ dictionary to ActiveMapper, will send kw ↵Mike Bayer2007-02-071-2/+6
| | | | | | options to Table objects [ticket:462]
* - added distinct() method to SelectResults. generally should only make a ↵Mike Bayer2007-02-051-0/+6
| | | | | | difference when using count().
* added 'ascii' as default encoding in case getdefaultlocale()[1] comes up ↵Mike Bayer2007-02-041-1/+1
| | | | with None (see [ticket:457])
* - the "polymorphic_primaryjoin" again goes against the parent's ↵Mike Bayer2007-02-011-2/+2
| | | | | | | | | | non-polymorphic local table. lazy load clause evaluation is plenty solid enough to handle it this time. - the join_to() method on PropertyLoader takes the parent mapper as an argument and alisiazes the primaryjoin against that mapper's selectable, so that the same primary join can be used against the base mapper, any inheriting mapper, etc., whether or not it uses a polymorphic union (although needs to be tested against alternate polymorphic unions added on subclasses). fixes [ticket:448]
* further work on insuring clear_mappers() really works. assignmapper identifiedMike Bayer2007-01-301-0/+1
| | | | | as a much trickier thing to clean out. added a unit test so that if any new collections get introduced we are still testing.
* removed various print statementsMike Bayer2007-01-281-3/+0
|
* merged the polymorphic relationship refactoring branch in. i want to go ↵Mike Bayer2007-01-281-3/+9
| | | | | | | | | | | | | further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far. - relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin. - lazy/eagerloaders work from those polymorphic join objects. - the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly. - Query builds itself against the base Mapper again, not the "polymorphic" mapper. uses the "polymorphic" version only as appropriate. this helps join_by/join_to/etc to work with polymorphic mappers. - Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically. - quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself). - the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.