Commit Graph

4336 Commits

Author SHA1 Message Date
Mike Bayer ccdd7f603e fix crappity 2009-03-27 21:42:41 +00:00
Mike Bayer d65c25bcc9 - Fixed __repr__() and other _get_colspec() methods on
ForeignKey constructed from __clause_element__() style
construct (i.e. declarative columns).  [ticket:1353]
2009-03-27 21:41:36 +00:00
Michael Trier e26b9e5f98 Corrected problem with information schema not working with binary collation on mssql. Fixes #1343. 2009-03-27 21:27:34 +00:00
Mike Bayer 18106b5e5b - Fixed the "set collection" function on "dynamic" relations
to initiate events correctly.  Previously a collection
could only be assigned to a pending parent instance,
otherwise modified events would not be fired correctly.
Set collection is now compatible with merge(),
fixes [ticket:1352].
2009-03-27 19:54:10 +00:00
Mike Bayer 3223bafafe more tests rel_0_5_3 2009-03-24 01:22:38 +00:00
Mike Bayer 533a0ab955 - Fixed bug in dynamic_loader() where append/remove events
after construction time were not being propagated to the
      UOW to pick up on flush(). [ticket:1347]
2009-03-24 01:19:45 +00:00
Mike Bayer 0bb1e1b8e3 add collections module to API ref for completeness. links to the mapper documentation
which is less wordy.
2009-03-21 18:03:47 +00:00
Mike Bayer 0983b610b4 - An alias() of a select() will convert to a "scalar subquery"
when used in an unambiguously scalar context, i.e. it's used
in a comparison operation.  This applies to
the ORM when using query.subquery() as well.
2009-03-21 16:12:37 +00:00
Mike Bayer 3ecf84f5ad - Fixed SQLite reflection methods so that non-present
cursor.description, which triggers an auto-cursor
      close, will be detected so that no results doesn't
      fail on recent versions of pysqlite which raise
      an error when fetchone() called with no rows present.
2009-03-17 15:09:49 +00:00
Mike Bayer 53deb98918 - Query.join() can now construct multiple FROM clauses, if
needed.  Such as, query(A, B).join(A.x).join(B.y)
might say SELECT A.*, B.* FROM A JOIN X, B JOIN Y.
Eager loading can also tack its joins onto those
multiple FROM clauses.  [ticket:1337]
2009-03-15 03:02:42 +00:00
Mike Bayer 3f0252abc7 - Fixed bug where column_prefix wasn't being checked before
not mapping an attribute that already had class-level
      name present.
2009-03-11 21:45:57 +00:00
Mike Bayer bef0bb95e7 fix formatting to match unit tests 2009-03-11 05:48:02 +00:00
Jonathan Ellis a4ee98fe66 add schema to entity method 2009-03-09 21:24:43 +00:00
Mike Bayer 68ee348d36 - a forward and complementing backwards reference which are both
of the same direction, i.e. ONETOMANY or MANYTOONE,
is now detected, and an error message is raised.
Saves crazy CircularDependencyErrors later on.
2009-03-09 01:20:29 +00:00
Mike Bayer 1b5d224df5 take 2 2009-03-08 19:40:12 +00:00
Mike Bayer dc7974deae attempt to exlude sqlite 3.5.9 and below, for buildbot failure. not clear which version of sqlite fixes this particular issue 2009-03-08 19:29:56 +00:00
Mike Bayer de06f512db - Query.group_by() properly takes into account aliasing applied
to the FROM clause, such as with select_from(), using
with_polymorphic(), or using from_self().
2009-03-08 19:06:12 +00:00
Mike Bayer 3953fe0ad4 some buildbot fixes 2009-03-08 02:35:46 +00:00
Mike Bayer 4928ea0e46 - updated builders for latest sphinx tip
- applied patch from [ticket:1321]
2009-03-02 00:01:09 +00:00
Mike Bayer b84c3b3469 - The "objects" argument to session.flush() is deprecated.
State which represents the linkage between a parent and
child object does not support "flushed" status on
one side of the link and not the other, so supporting
this operation leads to misleading results.
[ticket:1315]
2009-03-01 23:53:58 +00:00
Mike Bayer 77d6d31542 - Added PGUuid and PGBit types to
sqlalchemy.databases.postgres. [ticket:1327]

- Refection of unknown PG types won't crash when those
types are specified within a domain.  [ticket:1327]

- executemany() in conjunction with INSERT..RETURNING is documented as undefined by psycopg2.
2009-03-01 20:24:02 +00:00
Mike Bayer 8d295ec118 - Fixed adaptation of EXISTS clauses via any(), has(), etc.
in conjunction with an aliased object on the left and
of_type() on the right.  [ticket:1325]
2009-02-26 15:16:06 +00:00
Lele Gaifax b2204616c7 Fix markup glitch 2009-02-25 13:20:38 +00:00
Mike Bayer a8021432b8 - pared down private and semi-private functions in the attributes package.
- simplified the process of establishment and unestablishment of
class management from a mapper perspective; class manager setup/teardown
is now symmetric (ClassManager would never be fully de-associated previously).
- class manager now unconditionally decorates __init__.  this has a slight
behavior change for an unmapped subclass of a mapped superclass, in that
InstanceState creation corresponds to that of the superclass.  This
still doesn't allow unmapped subclasses to be usable in mapper
situations, though.
2009-02-23 00:08:37 +00:00
Mike Bayer b60185a078 - Declarative will accept a table-bound column as a property
when used in conjunction with __table__, if the column is already
present in __table__.  The column will be remapped to the given
key the same way as when added to the mapper() properties dict.
2009-02-22 19:35:36 +00:00
Mike Bayer e8b57a47cd - Query won't fail with weakref error when a non-mapper/class
instrumented descriptor is passed, raises
"Invalid column expession".
2009-02-20 15:45:25 +00:00
Mike Bayer 734e02c4f1 - Declarative locates the "inherits" class using a search
through __bases__, to skip over mixins that are local
to subclasses.
2009-02-19 15:48:37 +00:00
Gaëtan de Menten 40b20c680a fix docstring indent in orm.util.with_parent 2009-02-19 07:40:25 +00:00
Michael Trier 07e28e74ee Corrected issue on mssql where max_identifier_length was not being respected. 2009-02-18 03:34:58 +00:00
Mike Bayer 911c7b9b36 - Session.scalar() now converts raw SQL strings to text()
the same way Session.execute() does and accepts same
alternative **kw args.
2009-02-17 23:10:52 +00:00
Mike Bayer 38c9a5be50 - Declarative will properly interpret the "foreign_keys" argument
on a backref() if it's a string.
2009-02-17 22:09:30 +00:00
Mike Bayer 689a144a71 - Fixed a recursive pickling issue in serializer, triggered
by an EXISTS or other embedded FROM construct.
2009-02-17 12:56:48 +00:00
Mike Bayer e329fb3178 - Declarative figures out joined-table inheritance primary join
condition even if "inherits" mapper argument is given
explicitly.  Allows mixins to be used with joined table
inheritance.
2009-02-16 23:49:53 +00:00
Mike Bayer 2cee9cb243 - Added an attribute helper method `set_committed_value` in
sqlalchemy.orm.attributes.  Given an object, attribute name,
and value, will set the value on the object as part of its
"committed" state, i.e. state that is understood to have
been loaded from the database.   Helps with the creation of
homegrown collection loaders and such.
- documented public attributes helper functions.
2009-02-15 20:43:14 +00:00
Mike Bayer 1de9012573 - annotations store 'parententity' as well as 'parentmapper'
- ORMAdapter filters all replacements against a non-compatible 'parentmapper' annotation
- Other filterings, like
query(A).join(A.bs).filter(B.foo=='bar'), were erroneously
adapting "B.foo" as though it were an "A".
2009-02-13 18:08:40 +00:00
Rick Morrison 7954673ea7 Preliminary support for pymssql 1.0.1 [Ticket:1318] 2009-02-13 17:18:52 +00:00
Mike Bayer f180cc0c9f - Fixed bugs in Query regarding simultaneous selection of
multiple joined-table inheritance entities with common base
classes, previously the adaption applied to "e2" on
"e1 JOIN e2" would be partially applied to "e1".  Additionally,
comparisons on relations (i.e. Entity2.related==e2)
were not getting adapted correctly.
2009-02-13 17:14:05 +00:00
Mike Bayer 2d6b3f09eb move test by itself so that no fixture data is inserted 2009-02-12 16:02:23 +00:00
Mike Bayer 1d3185139a - a session.expire() on a particular collection attribute
will clear any pending backref additions as well, so that
the next access correctly returns only what was present
in the database.  Presents some degree of a workaround for
[ticket:1315], although we are considering removing the
flush([objects]) feature altogether.
2009-02-11 20:38:30 +00:00
Mike Bayer 60dd7842f0 - Added "post_configure_attribute" method to InstrumentationManager,
so that the "listen_for_events.py" example works again.
[ticket:1314]
2009-02-11 18:23:35 +00:00
Gaëtan de Menten a9817ae244 fix Query.update docstring 2009-02-10 11:25:25 +00:00
Mike Bayer 03b5b34114 - anonymous alias names now truncate down to the max length
allowed by the dialect.  More significant on DBs like
Oracle with very small character limits. [ticket:1309]
2009-02-10 01:20:45 +00:00
Mike Bayer 6336e55069 need sizes for mysql 2009-02-07 22:18:40 +00:00
Mike Bayer 2dba55cb27 - When flushing partial sets of objects using session.flush([somelist]),
pending objects which remain pending after the operation won't
inadvertently be added as persistent. [ticket:1306]
2009-02-07 21:57:30 +00:00
Mike Bayer 1c751e3ddb - PG Index reflection won't fail when an index with
multiple expressions is encountered.
2009-02-03 00:22:01 +00:00
Gaëtan de Menten 76e001d39e fix docstring typo 2009-02-02 09:32:56 +00:00
Mike Bayer e39b98ca7b - Fixed missing _label attribute on Function object, others
when used in a select() with use_labels (such as when used
in an ORM column_property()).  [ticket:1302]
2009-02-01 18:20:20 +00:00
Michael Trier 4b252f659e Added a few IDENTITY tests for mssql. 2009-01-31 21:20:04 +00:00
Mike Bayer 85e8509399 detect backref string as basestring, not str. [ticket:1301] 2009-01-30 22:47:28 +00:00
Mike Bayer 0749bc3850 appease older sqlite version 2009-01-29 17:03:49 +00:00