Commit Graph

71 Commits

Author SHA1 Message Date
Mike Bayer ccafaab200 restore py2k directive that got whacked by python tidy 2010-07-13 20:40:58 -04:00
Mike Bayer f2b43da1a8 tidy test/base, test/ex, test/ext 2010-07-11 13:41:38 -04:00
Mike Bayer 0adf381d99 - Fixed @memoized_property and @memoized_instancemethod
decorators so that Sphinx documentation picks up
these attributes and methods, such as
ResultProxy.inserted_primary_key. [ticket:1830]
2010-06-19 14:08:20 -04:00
Mike Bayer cfe9fadc61 change the weakkeydict to be just an LRU cache. Add tests
for the "many combinations of UPDATE keys" issue.
2010-05-31 11:56:08 -04:00
Mike Bayer 74a417a599 dont use collections on 2.4 2010-04-14 18:38:11 -04:00
Mike Bayer 8ee0590270 breakthrough, wow 2010-04-05 18:48:57 -04:00
Mike Bayer 23a49e346b - further reduce what topological has to do, expects full list of nodes
- fix some side-effect-dependent behaviors in uow.  we can now
unconditionally remove "disabled" actions without rewriting
2010-04-04 12:24:01 -04:00
Mike Bayer 03fecba819 really got topological going. now that we aren't putting fricking mapped objects into
it all that id() stuff can go
2010-03-31 15:12:29 -04:00
Mike Bayer b9f1a92493 This is turning out to be a rewrite of the accounting system of unitofwork.py, but the overarching
method of doing things stays the same.   it should be easy to add new dependencies
between actions and to change the structure of how things are done.
2010-03-30 19:19:41 -04:00
Mike Bayer 62d6bf4cc3 start sketching ideas for a rewritten unit of work.
the basic idea is to bring topological back down to the raw function,
then the whole UOW constructs itself as very fine grained elements with
full dependencies to each other.  then a straight execute with a straight sort.
the hope is that the mechanism here would be vastly simpler.  while
the presence of a large number of fine-grained records may be expensive
it still is potentially a lot easier to distill into C code, as the
uow's structure now consists of data.
2010-03-19 16:59:52 -04:00
Chris Withers 165eda5733 a handy @classproperty decorator 2010-02-23 17:17:08 +00:00
Mike Bayer 154f5a9434 generalized "test all the picklers" iterator works cross platform 2010-02-22 16:35:35 +00:00
Michael Trier 8c0567ea83 Fixed cPickle problem in Python3. 2010-02-20 23:08:18 +00:00
Mike Bayer 0b185fc84f - make frozendict serializable
- serialize tests use HIGHEST_PROTOCOL
2010-01-28 22:47:25 +00:00
Mike Bayer e7241263aa python3k fixes 2009-08-09 20:50:46 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00
Mike Bayer c84dd331df slight cleanup i want in 0.5/0.6 2009-05-31 21:27:56 +00:00
Mike Bayer 853992649c more fixes to bound parameter exception reporting 2009-05-26 17:03:03 +00:00
Mike Bayer d6b9757778 - added unit test for exception formatting
- Deprecated the hardcoded TIMESTAMP function, which when
used as func.TIMESTAMP(value) would render "TIMESTAMP value".
This breaks on some platforms as Postgres doesn't allow
bind parameters to be used in this context.  The hard-coded
uppercase is also inappropriate and there's lots of other
PG casts that we'd need to support.  So instead, use
text constructs i.e. select(["timestamp '12/05/09'"]).
2009-05-26 01:00:46 +00:00
Michael Trier a7e0fdd5fc Added copy and __copy__ methods to the OrderedDict. Fixes #1377. 2009-04-13 04:25:41 +00:00
Mike Bayer 345eaeed74 WeakCompositeKey was coded incorrectly and was not weakly referencing anything. However when repaired, the usage within RelationLoader._create_joins() still creates cycles between key elements and the value placed in the dict. In the interests of risk reduction, WCK is now removed and the two caches it was used for are now non-cached. Speed comparisons with one join/eager-heavy web application show no noticeable effect in response time. 2009-01-17 06:27:02 +00:00
Jonathan Ellis 3373994cfd emacs 2008-12-31 14:25:53 +00:00
Mike Bayer d76dc73f33 merge the test/ directory from -r5438:5439 of py3k_warnings branch. this gives
us a 2.5-frozen copy of unittest so we're insulated from unittest changes.
2008-12-18 18:11:12 +00:00
Mike Bayer be5d326343 merged -r5299:5438 of py3k warnings branch. this fixes some sqlite py2.6 testing issues,
and also addresses a significant chunk of py3k deprecations.  It's mainly
expicit __hash__ methods.  Additionally, most usage of sets/dicts to store columns uses
util-based placeholder names.
2008-12-18 17:57:15 +00:00
Mike Bayer ed3e3f2571 - util.flatten_iterator() func doesn't interpret strings with
__iter__() methods as iterators, such as in pypy [ticket:1077].
2008-10-31 21:44:34 +00:00
Mike Bayer 3bf1ddfb91 a much easier way to ArgSingleton 2008-10-12 04:25:53 +00:00
Jason Kirtland aaf72e05f1 - Ignore old-style classes when building inheritance graphs. [ticket:1078] 2008-08-15 22:54:35 +00:00
Jason Kirtland 8fa48edbf9 - Removed 2.3 set emulations/enhancements.
(sets.Set-based collections & DB-API returns still work.)
2008-07-15 19:23:52 +00:00
Jason Kirtland 8b6855fc2c Added default support to OrderedDict.pop [ticket:585] 2008-07-10 19:16:08 +00:00
Jason Kirtland eaa4328aac - consider args[0] as self when introspecting def(*args): ... [ticket:1091] 2008-06-29 18:58:11 +00:00
Mike Bayer 4a6afd469f r4695 merged to trunk; trunk now becomes 0.5.
0.4 development continues at /sqlalchemy/branches/rel_0_4
2008-05-09 16:34:10 +00:00
Jason Kirtland afd8431d4d - Pool listeners may now be specified as a duck-type of PoolListener or a dict of callables, your choice. 2008-04-04 19:07:30 +00:00
Jason Kirtland a86dc8cbac - symbols now depickle properly
- fixed some symbol __new__ abuse
2008-03-19 18:02:47 +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 e94c3ba27a - IdentitySet binops no longer accept plain sets. 2008-01-24 01:00:41 +00:00
Jason Kirtland f6439ffa2c Corrected behavior of get_cls_kwargs and friends 2008-01-24 00:08:40 +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 4be99db15b - Restored 2.3 compat. in lib/sqlalchemy
- Part one of test suite fixes to run on 2.3
  Lots of failures still around sets; sets.Set differs from __builtin__.set
  particularly in the binops. We depend on set extensively now and may need to
  provide a corrected sets.Set subclass on 2.3.
2008-01-19 23:37:11 +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
Mike Bayer 0df750223a - merged instances_yields branch r3908:3934, minus the "yield" part which remains slightly problematic
- cleanup of mapper._instance, query.instances().  mapper identifies objects which are part of the
current load using a app-unique id on the query context.
- attributes refactor; attributes now mostly use copy-on-modify instead of copy-on-load behavior,
simplified get_history(), added a new set of tests
- fixes to OrderedSet such that difference(), intersection() and others can accept an iterator
- OrderedIdentitySet passes in OrderedSet to the IdentitySet superclass for usage in difference/intersection/etc. operations so that these methods actually work with ordering behavior.
- query.order_by() takes into account aliased joins, i.e.  query.join('orders', aliased=True).order_by(Order.id)
- cleanup etc.
2007-12-14 05:53:18 +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 1b1f8d78df fixed test which didnt pass along 'allitems' collection to the sort... 2007-12-08 19:15:12 +00:00
Mike Bayer 8693d4b287 - flush() refactor merged from uow_nontree branch r3871-r3885
- topological.py cleaned up, presents three public facing functions which
return list/tuple based structures, without exposing any internals.  only
the third function returns the "hierarchical" structure.  when results
include "cycles" or "child" items, 2- or 3- tuples are used to represent
results.
- unitofwork uses InstanceState almost exclusively now.  new and deleted lists
are now dicts which ref the actual object to provide a strong ref for the
duration that they're in those lists.  IdentitySet is only used for the public
facing versions of "new" and "deleted".
- unitofwork topological sort no longer uses the "hierarchical" version of the sort
for the base sort, only for the "per-object" secondary sort where it still
helps to group non-dependent operations together and provides expected insert
order.  the default sort deals with UOWTasks in a straight list and is greatly
simplified.  Tests all pass but need to see if svilen's stuff still works,
one block of code in _sort_cyclical_dependencies() seems to not be needed anywhere
but i definitely put it there for a reason at some point; if not hopefully we
can derive more test coverage from that.
- the UOWEventHandler is only applied to object-storing attributes, not
scalar (i.e. column-based) ones.  cuts out a ton of overhead when setting
non-object based attributes.
- InstanceState also used throughout the flush process, i.e. dependency.py,
mapper.save_obj()/delete_obj(), sync.execute() all expect InstanceState objects
in most cases now.
- mapper/property cascade_iterator() takes InstanceState as its argument,
but still returns lists of object instances so that they are not dereferenced.
- a few tricks needed when dealing with InstanceState, i.e. when loading a list
of items that are possibly fresh from the DB, you *have* to get the actual objects
into a strong-referencing datastructure else they fall out of scope immediately.
dependency.py caches lists of dependent objects which it loads now (i.e. history
collections).
- AttributeHistory is gone, replaced by a function that returns a 3-tuple of
added, unchanged, deleted.  these collections still reference the object
instances directly for the strong-referencing reasons mentiontioned, but
it uses less IdentitySet logic to generate.
2007-12-08 18:58:03 +00:00
Mike Bayer 78bb82a44b changed the anonymous numbering scheme to be more appealing
got tests running
2007-12-08 18:38:18 +00:00
Jason Kirtland 661774055c Added util.IdentitySet to support [ticket:676] and [ticket:834] 2007-10-31 09:13:12 +00:00
Mike Bayer 4127d22196 - fixed clear_mappers() behavior to better clean up after itself 2007-10-27 00:24:43 +00:00
Jason Kirtland 9d7c027cb7 - Now guarding against broken DB-APIs when wrapping their exceptions.
- Added an explicit test for exception wrapping.
2007-10-22 19:24:02 +00:00
Jason Kirtland 6228e72cb1 - omitted 'table' and 'column' from 'from sqlalchemy import *'
- also omitted all modules and classes that aren't expicitly public
- omitted 'Smallinteger' (small i), but it's still in schema
- omitted NullType-related items from types.__all__
- patched up a few tests to use sql.table and sql.column, other related.
2007-08-21 01:31:23 +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