Commit Graph

413 Commits

Author SHA1 Message Date
Mike Bayer 8ef1bded27 added nicer error message to dependent class not found 2008-03-22 22:30:08 +00:00
Mike Bayer b9a67d1458 - added support for declarative deferred(Column(...))
- changed "instrument" argument on synonym() to "descriptor", for consistency with comparable_proeprty()
2008-03-18 17:42:07 +00:00
Mike Bayer 3d5a852b1d mapper double checks that columns in _compile_property are in the _cols_by_table collection 2008-03-18 02:38:11 +00:00
Jason Kirtland c35a717140 - Start coverage for Class.prop = Column(), promote nameless Columns 2008-03-18 02:16:15 +00:00
Jason Kirtland c462e42dfd - Declarative will complete setup for Columns lacking names, allows
a more DRY syntax.

    class Foo(Base):
        __tablename__ = 'foos'
        id = Column(Integer, primary_key=True)
2008-03-18 00:25:55 +00:00
Jason Kirtland 22197ca9c5 - Declarative gains @synonym_for and @comparable_using decorators 2008-03-17 22:55:43 +00:00
Jason Kirtland 9e15993083 Issue a warning when a declarative detects a likely trailing comma: foo = Column(foo), 2008-03-15 23:13:35 +00:00
Mike Bayer 288f9d53e3 - the "synonym" function is now directly usable with
"declarative".  Pass in the decorated property using
the "instrument" keyword argument, e.g.:
somekey = synonym('_somekey', instrument=property(g, s))
- declared_synonym deprecated
2008-03-15 20:18:54 +00:00
Mike Bayer d910cce949 reflection tests require foreign key reflection support 2008-03-11 19:15:04 +00:00
Mike Bayer 80d52d7a24 remove redundant test_rekey() test method 2008-03-10 20:19:38 +00:00
Jason Kirtland 0ad1aaa388 - Test autoload with a FK override 2008-03-10 19:21:49 +00:00
Jason Kirtland 6eeb43e5c2 - Added a primaryjoin= test 2008-03-10 18:40:36 +00:00
Jason Kirtland ac13a8445b - Added __autoload__ = True for declarative
- declarative Base.__init__ is pickier about its kwargs
2008-03-10 18:32:07 +00:00
Mike Bayer 88a8cc0c9e - a new super-small "declarative" extension has been added,
which allows Table and mapper() configuration to take place
inline underneath a class declaration.  This extension differs
from ActiveMapper and Elixir in that it does not redefine
any SQLAlchemy semantics at all; literal Column, Table
and relation() constructs are used to define the class
behavior and table definition.
2008-03-10 17:14:08 +00:00
Mike Bayer c0b5a0446b - updated the naming scheme of the base test classes in test/testlib/testing.py;
tests extend from either TestBase or ORMTest, using additional mixins for
special assertion methods as needed
2008-02-11 00:28:39 +00:00
Jason Kirtland ed74083956 - Flipped join order of __radd__ on association proxied lists. 2008-01-24 01:12:46 +00:00
Jason Kirtland 412c80dd6c - 2.3 fixup, part two: 100% passing for sqlite
- added 2.4-style binops to util.Set on 2.3
  - OrderedSets pickle on 2.3
  - more lib/sqlalchemy set vs Set corrections
  - fixed InstrumentedSet.discard for 2.3
  - set, sorted compatibility for test suite
- added testing.fails_if decorator
2008-01-21 23:19:39 +00:00
Jason Kirtland 17d3c8764e - testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase
- testing.db has the configured db
- Fixed up the perf/* scripts
2008-01-12 22:03:42 +00:00
Jason Kirtland bf36c648f2 Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. No surprises. 2008-01-10 02:37:39 +00:00
Jason Kirtland 84576e3258 test suite deprecation rampage 2008-01-09 22:54:51 +00:00
Jason Kirtland 912432179a Silenced deprecation warnings when testing deprecated extensions... 2008-01-09 20:41:14 +00:00
Jason Kirtland 4c705b6089 Added explicit length to more testing String columns. 2008-01-09 20:29:04 +00:00
Jason Kirtland 2bc1c28c44 More overloads: fix cascades for += on a list relation, added operator support to association proxied lists. 2008-01-05 19:11:58 +00:00
Jason Kirtland a230391a37 Fixed in-place set mutation operator support [ticket:920] 2008-01-04 20:17:42 +00:00
Jason Kirtland 273e48c9a9 - Raise an error when assigning a bogusly keyed dictionary to one of the builtin dict-based collection types [ticket:886]
- Collections gain a @converter framework for flexible validation and adaptation of bulk assignment
- Bogus bulk assignments now raise TypeError instead of exceptions.ArgumentError
2007-12-14 00:13:18 +00:00
Mike Bayer 2e9501683d - session checks more carefully when determining "object X already in another session";
e.g. if you pickle a series of objects and unpickle (i.e. as in a Pylons HTTP session
or similar), they can go into a new session without any conflict
- added stricter checks around session.delete() similar to update()
- shored up some old "validate" stuff in session/uow
2007-11-01 20:12:36 +00:00
Jason Kirtland 52d5151aa4 - Removed unused util.hash()
- Fixed __hash__ for association proxy collections
2007-10-31 03:25:04 +00:00
Jason Kirtland 259b256759 - Don't re-save objects in these tests (post r3681) 2007-10-31 03:17:51 +00:00
Jason Kirtland d433ec4f0d Changed some columns from TEXT to VARCHAR for sapdb. 2007-10-22 23:01:02 +00:00
Paul Johnston a0ed498ff5 Fix ActiveMapper unit tests 2007-10-13 00:01:11 +00:00
Jason Kirtland fba14f6047 from foo import (name, name) isn't valid syntax for 2.3. ah well.
omitting modules from sqlalchemy.__all__...
2007-08-21 22:20:52 +00:00
Mike Bayer 109d535961 - method call removal 2007-08-20 21:50:59 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Jason Kirtland 177d30cc01 - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData instead
- Deprecated BoundMetaData- use MetaData instead
- Removed DMD and BMD from documentation
2007-07-06 00:58:09 +00:00
Jason Kirtland 6cd584d303 - Fixed typo blocking some assoc proxy dict assignments, added test 2007-06-16 22:04:13 +00:00
Jason Kirtland 84420a1d0f - Iteration over dict association proxies is now dict-like, not
InstrumentedList-like (e.g. over keys instead of values).
- Don't tightly bind proxies to source collections (fixes #597)
- Handle slice objects on orderinglist's __setitem__
2007-06-14 00:11:51 +00:00
Jason Kirtland 76a1d1276c Oops, Python 2.5 ternary operator snuck in. 2007-05-03 21:51:34 +00:00
Jason Kirtland 5606c01d39 - Test assoc proxy lazy loads, fixed __set__ race on single scalar assocs 2007-05-03 18:22:31 +00:00
Jason Kirtland 300d1d2c13 - New association proxy implementation, implementing complete proxies to list, dict and set-based relation collections (and scalar relations). Extensive tests.
- Added util.duck_type_collection
2007-05-03 00:57:59 +00:00
Jason Kirtland bb7a29d622 - added sqlalchemy.ext.orderinglist, a custom list class that synchronizes an object attribute with that object's position in the list 2007-05-02 20:17:31 +00:00
Rick Morrison 0a09256619 mssql: now passes still more unit tests, [ticket:481] 2007-03-19 02:00:32 +00:00
Mike Bayer c249066dbf "alltests" runners call testbase.main(), which takes an optional suite,
so that exit code is propigated
2007-03-15 18:11:05 +00:00
Rick Morrison 30b20e3c56 MSSQL now passes still more unit tests [ticket:481]
Fix to null FLOAT fields in mssql-trusted.patch
MSSQL: LIMIT with OFFSET now raises an error
MSSQL: can now specify Windows authorization
MSSQL: ignores seconds on DATE columns (DATE fix, part 1)
2007-03-15 02:31:15 +00:00
Mike Bayer b2e04755cc - the full featureset of the SelectResults extension has been merged
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.
2007-03-10 02:49:12 +00:00
Mike Bayer 231acabf72 - options() method on SelectResults now implemented "generatively"
like the rest of the SelectResults methods [ticket:472]
2007-03-07 01:31:41 +00:00
Mike Bayer 142d3f4bfd added unit tests illustrating current workaround for assignmapper method name/collection class collision 2007-01-24 22:43:25 +00:00
Mike Bayer b6b0130646 - made kwargs parsing to Table strict; removed various obsoluete "redefine=True" kw's from the unit tests
- documented instance variables in ANSICompiler
- fixed [ticket:120], adds "inline_params" set to ANSICompiler which DefaultDialect picks up on when
determining defaults.  added unittests to query.py
- additionally fixed up the behavior of the "values" parameter on _Insert/_Update
- more cleanup to sql/Select - more succinct organization of FROM clauses, removed silly _process_from_dict
methods and JoinMarker object
2006-11-26 02:36:27 +00:00
Mike Bayer 19fcb943c4 - cleanup on some instance vars in Select (is_scalar, is_subquery, _froms is __froms, removed unused 'nowait', '_text', etc)
- cleaned up __repr__ on Column, AbstractTypeEngine
- added standalone intersect(_all), except(_all) functions, unit tests illustrating nesting patterns [ticket:247]
2006-11-25 21:32:26 +00:00
Mike Bayer aeb8c429bf - implemented from_obj argument for query.count, improves count function
on selectresults [ticket:325]
2006-11-02 21:31:56 +00:00
Mike Bayer 97feb4dbee - docstring on polymorphic_mapping
- applied Simon Wittber's ActiveMapper version_id_col patch for [ticket:348]
2006-10-21 23:15:13 +00:00