Commit Graph

  • e630b322f6 Fixed minor reST issue Lele Gaifax 2007-12-15 10:08:37 +00:00
  • 8e5cf37a70 Documentation markup and a few typos Lele Gaifax 2007-12-15 09:50:35 +00:00
  • 50ce0006a5 Implemented FBDialect.server_version_info() Lele Gaifax 2007-12-15 09:02:41 +00:00
  • 8cf05355bb oof...unicode object still needs to return the value if it just warned... Mike Bayer 2007-12-14 23:47:33 +00:00
  • 379d333c31 oof, history on collections were wrong. fixed byroot_tree test as well Mike Bayer 2007-12-14 23:28:10 +00:00
  • 6c4ad36cc9 - simplified _mapper_registry further. its now just a weakkeydict of mapper->True, stores all mappers including non primaries, and is strictly used for the list of "to compile/dispose". - all global references are now weak referencing. if you del a mapped class and any dependent classes, its mapper and all dependencies fall out of scope. - attributes.py still had issues which were barely covered by tests. added way more tests (coverage.py still says 71%, doh) fixed things, took out unnecessary commit to states. attribute history is also asserted for ordering. Mike Bayer 2007-12-14 23:11:13 +00:00
  • d73d0f420c added an inheritance test Mike Bayer 2007-12-14 18:08:55 +00:00
  • 1bf1f97f73 Firebird module documentation Lele Gaifax 2007-12-14 16:45:46 +00:00
  • f44a7f6ae9 correction... Jason Kirtland 2007-12-14 10:30:14 +00:00
  • 1694e33838 try to bang mysql tests to work Mike Bayer 2007-12-14 06:29:31 +00:00
  • 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. Mike Bayer 2007-12-14 05:53:18 +00:00
  • 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 Jason Kirtland 2007-12-14 00:13:18 +00:00
  • 94355aebe6 Fixed some __repr__'s attempting to %d their not-yet-assigned primary key ids. Jason Kirtland 2007-12-13 21:56:52 +00:00
  • c0f48e8383 Firebird does use qmark style params Lele Gaifax 2007-12-13 20:16:23 +00:00
  • 2c3c081fb0 Use the external strlen UDF for func.length() under Firebird Lele Gaifax 2007-12-13 15:53:35 +00:00
  • 8128a6378a - Removed @testing.supported. Dialects in development or maintained outside the tree can now run the full suite of tests out of the box. - Migrated most @supported to @fails_on, @fails_on_everything_but, or (last resort) @unsupported. @fails_on revealed a slew of bogus test skippage, which was corrected. - Added @fails_on_everything_but. Yes, the first usage *was* "fails_on_everything_but('postgres')". How did you guess! - Migrated @supported in dialect/* to the new test-class attribute __only_on__. - Test classes can also have __unsupported_on__ and __excluded_on__. Jason Kirtland 2007-12-13 09:59:14 +00:00
  • 2522534311 Disabled some tests with INTERSECT, not handled by Firebird Lele Gaifax 2007-12-12 23:06:22 +00:00
  • bdc12f2468 Use an external UDF to implement the mod operator under Firebird Lele Gaifax 2007-12-12 23:00:42 +00:00
  • 6f6a098135 bug fixes Chris Mcdonough 2007-12-12 20:20:03 +00:00
  • bdd922ad0d Some code-level docs for r3916 Jason Kirtland 2007-12-12 20:18:58 +00:00
  • 5c14b20f9f implemented many-to-one comparisons to None generate <column> IS NULL, with column on the left side in all cases Mike Bayer 2007-12-12 17:56:52 +00:00
  • 16810e4011 New simple test for Dialect.has_sequence() Lele Gaifax 2007-12-12 17:24:56 +00:00
  • bfb33f7959 - on mysql, emit inner joins as 'INNER JOIN ... ON' (for version 3.23) Jason Kirtland 2007-12-12 16:39:10 +00:00
  • f38e24e263 Reflect Firebird PassiveDefaults - column's default values are properly reflected (also those coming from DOMAINs) - implemented .has_sequence() - fix type on FK reflection Lele Gaifax 2007-12-12 16:08:07 +00:00
  • 9a220fc769 Cosmetic changes to the Firebird reflection queries. This brings them more consistent with the syntax of the statements generated by SA, using lowercase field names. Lele Gaifax 2007-12-11 23:07:41 +00:00
  • 86f12f93cc - eagerload(), lazyload(), eagerload_all() take an optional second class-or-mapper argument, which will select the mapper to apply the option towards. This can select among other mappers which were added using add_entity(). Mike Bayer 2007-12-11 19:33:36 +00:00
  • edbfbf81f7 - fix to cascades on polymorphic relations, such that cascades from an object to a polymorphic collection continue cascading along the set of attributes specific to each element in the collection. Mike Bayer 2007-12-11 17:29:08 +00:00
  • c468a27444 comment Mike Bayer 2007-12-10 18:42:39 +00:00
  • cb8bf058b6 refresh_instance becomes an InstanceState so boolean tests are OK Mike Bayer 2007-12-10 18:08:16 +00:00
  • 41df778985 - more query tests - trying to refine some of the adaptation stuff - query.from_statement() wont allow further generative criterion - added a warning to columncollection when selectable is formed with conflicting columns (only in the col export phase) - some method rearrangement on schema/columncollection.... - property conflicting relation warning doesnt raise for concrete Mike Bayer 2007-12-10 04:31:17 +00:00
  • 5cdb942791 - Query.select_from() now replaces all existing FROM criterion with the given argument; the previous behavior of constructing a list of FROM clauses was generally not useful as is required filter() calls to create join criterion, and new tables introduced within filter() already add themselves to the FROM clause. The new behavior allows not just joins from the main table, but select statements as well. Filter criterion, order bys, eager load clauses will be "aliased" against the given statement. Mike Bayer 2007-12-09 23:27:04 +00:00
  • 7cbfbba949 Better reflection of Firebird data types. Instead of relying on internal numeric code, lookup the associated real name. This has the extra benefit of properly handling of DOMAINs. Lele Gaifax 2007-12-09 23:08:59 +00:00
  • 7758edfd74 fix... Mike Bayer 2007-12-09 18:27:01 +00:00
  • 120f13a500 add pydoc for from_statement(). Mike Bayer 2007-12-09 17:50:24 +00:00
  • 4f5aa12547 - added a warning when a relation() is added to an inheriting mapper that is present on a super-mapper; multiple DependencyProcessors are not expected during the flush process - found an uncovered line in uow, was "covered" by one particular breaking test Mike Bayer 2007-12-09 17:26:16 +00:00
  • 8b1beee112 add some updates too Mike Bayer 2007-12-09 16:13:27 +00:00
  • 901829a7e3 - added a test for boolean saves/retrieves Mike Bayer 2007-12-09 16:11:21 +00:00
  • f1ee3d406f - fix up the fixtures comparator - strengthened memory profiling test Mike Bayer 2007-12-09 15:56:37 +00:00
  • 362164c282 only report true for source change if added + deleted, dont pick up inserts Mike Bayer 2007-12-09 15:04:14 +00:00
  • d972b5e51b mapper uses attributes to get non-cached history Mike Bayer 2007-12-09 05:24:07 +00:00
  • 8fb0c0b4ce remove redundant identity map set Mike Bayer 2007-12-09 05:14:40 +00:00
  • acdb90784b - mutable primary key support is added. primary key columns can be changed freely, and the identity of the instance will change upon flush. In addition, update cascades of foreign key referents (primary key or not) along relations are supported, either in tandem with the database's ON UPDATE CASCADE (required for DB's like Postgres) or issued directly by the ORM in the form of UPDATE statements, by setting the flag "passive_cascades=False". Mike Bayer 2007-12-09 05:00:12 +00:00
  • c9b3f0bcef - added new methods to TypeDecorator, process_bind_param() and process_result_value(), which automatically take advantage of the processing of the underlying type. Ideal for using with Unicode or Pickletype. TypeDecorator should now be the primary way to augment the behavior of any existing type including other TypeDecorator subclasses such as PickleType. Mike Bayer 2007-12-08 23:03:22 +00:00
  • 65b204c122 some updates, remove an old test (really crufty old stuff here) Mike Bayer 2007-12-08 21:49:03 +00:00
  • 56c544edab [ticket:888] continued, synonym add_prop Mike Bayer 2007-12-08 19:56:11 +00:00
  • f4e3240812 ok found it Mike Bayer 2007-12-08 19:25:10 +00:00
  • 1b1f8d78df fixed test which didnt pass along 'allitems' collection to the sort... Mike Bayer 2007-12-08 19:15:12 +00:00
  • 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. Mike Bayer 2007-12-08 18:58:03 +00:00
  • 78bb82a44b changed the anonymous numbering scheme to be more appealing got tests running Mike Bayer 2007-12-08 18:38:18 +00:00
  • 377a57ea8d corrected for current output... Mike Bayer 2007-12-08 18:04:46 +00:00
  • 88518c203d added a mention about eagerload_all() [ticket:897] Mike Bayer 2007-12-08 17:07:40 +00:00
  • fbdc7d535d mapper.instances() is deprecated Mike Bayer 2007-12-07 20:14:10 +00:00
  • 6f5f86ad4a a little refinement to topological options, more to come Mike Bayer 2007-12-07 17:27:21 +00:00
  • 7bf90e2f4d fix to unique bind params, you *can* use the same unique bindparam multiple times in a statement. the collision check is strictly detecting non-unique's that happen to have the same name. Mike Bayer 2007-12-07 16:47:00 +00:00
  • 3715e10bf8 - also with dynamic, implemented correct count() behavior as well as other helper methods. Mike Bayer 2007-12-07 16:31:12 +00:00
  • 7ca4797537 - added "cascade delete" behavior to "dynamic" relations just like that of regular relations. if passive_deletes flag (also just added) is not set, a delete of the parent item will trigger a full load of the child items so that they can be deleted or updated accordingly. Mike Bayer 2007-12-07 16:13:19 +00:00
  • 33f62587cd fixed key error when no pks could be located Mike Bayer 2007-12-07 15:28:20 +00:00
  • 541b6772e9 - generation of "unique" bind parameters has been simplified to use the same "unique identifier" mechanisms as everything else. This doesn't affect user code, except any code that might have been hardcoded against the generated names. Generated bind params now have the form "<paramname>_<num>", whereas before only the second bind of the same name would have this form. Mike Bayer 2007-12-06 22:23:10 +00:00
  • 3ac9c93e26 warn if query.get() used with existing criterion Mike Bayer 2007-12-06 19:31:59 +00:00
  • 4580e77da2 - query.get() and query.load() do not take existing filter or other criterion into account; these methods *always* look up the given id in the database or return the current instance from the identity map, disregarding any existing filter, join, group_by or other criterion which has been configured. [ticket:893] Mike Bayer 2007-12-06 19:15:04 +00:00
  • 594784a206 assert_unicode=True replaced with default of assert_unicode='warn' Mike Bayer 2007-12-05 22:21:37 +00:00
  • 1c65cb025a - ordering of cols in pks_by_table and cols_by_table is significant; particularly for pks_by_table the ordering is expected to match the ordering of pk columns in the table for usage in query.get() as well as identity key generation Mike Bayer 2007-12-05 22:04:27 +00:00
  • c863f9fdec more assertion hints... Mike Bayer 2007-12-05 21:51:16 +00:00
  • 30a81eff3b improved assertions, test is failing on the buildbot only (not osx or linux) Mike Bayer 2007-12-05 21:34:22 +00:00
  • 261e76259a some more omit schemas for [ticket:890] Mike Bayer 2007-12-05 21:16:02 +00:00
  • a5f2aab9e0 - tables with schemas can still be used in sqlite, firebird, schema name just gets dropped [ticket:890] Mike Bayer 2007-12-05 21:14:09 +00:00
  • e0fa592169 - tables with schemas can still be used in sqlite, firebird, schema name just gets dropped [ticket:890] Mike Bayer 2007-12-05 21:13:36 +00:00
  • 9629838f7d - fixed wrong varname in session exception throw - fixed vertical example to just use a scoped session Mike Bayer 2007-12-05 20:55:33 +00:00
  • 9e4052dc8b - a major behavioral change to collection-based backrefs: they no longer trigger lazy loads ! "reverse" adds and removes are queued up and are merged with the collection when it is actually read from and loaded; but do not trigger a load beforehand. For users who have noticed this behavior, this should be much more convenient than using dynamic relations in some cases; for those who have not, you might notice your apps using a lot fewer queries than before in some situations. [ticket:871] Mike Bayer 2007-12-05 20:43:16 +00:00
  • 238c2c8dbe - basic framework for generic functions, [ticket:615] - changed the various "literal" generation functions to use an anonymous bind parameter. not much changes here except their labels now look like ":param_1", ":param_2" instead of ":literal" - from_obj keyword argument to select() can be a scalar or a list. Mike Bayer 2007-12-05 03:07:21 +00:00
  • c6bda7dcc8 - fixed backref bug where you could not del instance.attr if attr was None Mike Bayer 2007-12-04 17:55:25 +00:00
  • cb46ae4fe9 - relaxed rules on column_property() expressions having labels; any ColumnElement is accepted now, as the compiler auto-labels non-labeled ColumnElements now. a selectable, like a select() statement, still requires conversion to ColumnElement via as_scalar() or label(). Mike Bayer 2007-12-04 17:06:55 +00:00
  • f5a4554c52 typo Gaëtan de Menten 2007-12-04 16:22:44 +00:00
  • aa71eed4e2 fixed replacement of existing column properties with synonyms, [ticket:888] Mike Bayer 2007-12-04 15:53:23 +00:00
  • 0ec4e7d6b3 - moved class-level attributes placed by the attributes package into a _class_state variable attached to the class. - mappers track themselves primarily using the "mappers" collection on _class_state. ClassKey is gone and mapper lookup uses regular dict keyed to entity_name; removes a fair degree of WeakKeyDictionary overhead as well as ClassKey overhead. - mapper_registry renamed to _mapper_registry; is only consulted by the compile_mappers(), mapper.compile() and clear_mappers() functions/methods. Mike Bayer 2007-12-02 00:31:26 +00:00
  • c6d01a56e1 - several ORM attributes have been removed or made private: mapper.get_attr_by_column(), mapper.set_attr_by_column(), mapper.pks_by_table, mapper.cascade_callable(), MapperProperty.cascade_callable(), mapper.canload() - refinements to mapper PK/table column organization, session cascading, some naming convention work Mike Bayer 2007-12-01 23:00:05 +00:00
  • ebb4b02c21 added test to ensure two conflicting m2m + backrefs raise an error Mike Bayer 2007-11-30 21:25:42 +00:00
  • 8bf75013ac remove a little cruft Mike Bayer 2007-11-30 03:34:06 +00:00
  • 2b306350e2 - added support for version_id_col in conjunction with inheriting mappers. version_id_col is typically set on the base mapper in an inheritance relationship where it takes effect for all inheriting mappers. [ticket:883] - a little rearrangement of save_obj() Mike Bayer 2007-11-30 00:40:56 +00:00
  • e9abaaef9f - adjustment to the previous checkin regarding inheritance to not conflict with globals - fix to self-referential eager loading such that if the same mapped instance appears in two or more distinct sets of columns in the same result set, its eagerly loaded collection will be populated regardless of whether or not all of the rows contain a set of "eager" columns for that collection. this would also show up as a KeyError when fetching results with join_depth turned on. Mike Bayer 2007-11-29 19:37:05 +00:00
  • 74baa86b86 - fixed bug where Query would not apply a subquery to the SQL when LIMIT was used in conjunction with an inheriting mapper where the eager loader was only in the parent mapper. Mike Bayer 2007-11-29 15:36:13 +00:00
  • 2a94e3e6c5 cleanup Mike Bayer 2007-11-28 23:44:14 +00:00
  • 4d7f279d14 fixed unicode-ness for Unicode values Mike Bayer 2007-11-28 22:09:57 +00:00
  • efdd638cd2 - fixed bug which could arise when using session.begin_nested() in conjunction with more than one level deep of enclosing session.begin() statements Mike Bayer 2007-11-28 22:03:14 +00:00
  • 4ee7070223 new synonym() behavior, including auto-attribute gen, attribute decoration, and auto-column mapping implemented; [ticket:801] Mike Bayer 2007-11-28 21:13:35 +00:00
  • d56e11ffe2 default value of assert_unicode is None on String, False on create_engine(), and True on Unicode type. Mike Bayer 2007-11-28 00:44:16 +00:00
  • 3f6e94e818 - column labels in the form "tablename.columname", i.e. with a dot, are now supported. Mike Bayer 2007-11-27 16:57:56 +00:00
  • 6ed4645f02 opened up the test for "reflection with convert_unicode=True". this is since convert_unicode by default has assert_unicode, want to ensure that other dialects (at least oracle) support this (i.e. not unicode schema names themselves, just that they dont sent thru bytestrings to a String). Mike Bayer 2007-11-27 16:23:02 +00:00
  • ccdb725766 added None to support zope __provides__, [ticket:882] Mike Bayer 2007-11-27 16:15:32 +00:00
  • 65abc78010 added a test to validate ResultProxy truncation behavior Mike Bayer 2007-11-27 16:13:45 +00:00
  • 329703a371 un-screw up the attribute manager checkin Mike Bayer 2007-11-27 05:44:16 +00:00
  • 4cc7b51e20 fixed reflection of unicode, [ticket:881] Mike Bayer 2007-11-27 05:37:57 +00:00
  • 378c02348c AttributeManager class and "cached" state removed....attribute listing is tracked from _sa_attrs class collection Mike Bayer 2007-11-27 05:15:13 +00:00
  • e89f31e0df Fix: MSSQL set identity_insert and errors [ticket:538] Paul Johnston 2007-11-25 23:56:38 +00:00
  • 168bab1cf1 - check for NoneType too with unicode.... - fixed ORM tests to have proper unicode Mike Bayer 2007-11-25 23:46:05 +00:00
  • 6753cb7f72 MSSQL doesn't support subqueries in insert values; disable test Paul Johnston 2007-11-25 23:36:20 +00:00
  • 2c873f0ee4 Fix: test_decimal on MSSQL - use a value that is accurately represented as a float, and make when asdecimal=False, convert Decimal to float Paul Johnston 2007-11-25 23:34:39 +00:00
  • 37bffd8f2b edits Mike Bayer 2007-11-25 23:34:26 +00:00
  • 954f7b289b Fix: MSSQL concatenate operator is + not || [ticket:879] Paul Johnston 2007-11-25 23:17:02 +00:00
  • e4056a1787 - added new flag to String and create_engine(), assert_unicode=(True|False|None). When convert_unicode=True, this flag also defaults to True, and results in all unicode conversion operations raising an exception when a non-unicode bytestring is passed as a bind parameter. It is strongly advised that all unicode-aware applications make proper use of Python unicode objects (i.e. u'hello' and not 'hello'). Mike Bayer 2007-11-25 23:14:03 +00:00