Commit Graph

1770 Commits

Author SHA1 Message Date
Mike Bayer 29d4335b73 - Fixed @on_reconsitute hook for subclasses
which inherit from a base class.
[ticket:1129]
2008-08-08 05:13:23 +00:00
Mike Bayer 2829092cb8 - Improved the determination of the FROM clause
when placing SQL expressions in the query()
list of entities.  In particular scalar subqueries
should not "leak" their inner FROM objects out
into the enclosing query.
2008-08-06 20:58:48 +00:00
Mike Bayer 665cd4d36a - Temporarily rolled back the "ORDER BY" enhancement
from [ticket:1068].  This feature is on hold
pending further development.
2008-08-06 15:46:31 +00:00
Mike Bayer 4cd1902796 - The RowTuple object returned by Query(*cols) now
features keynames which prefer mapped attribute
names over column keys, column keys over
column names, i.e.
Query(Class.foo, Class.bar) will have names
"foo" and "bar" even if those are not the names
of the underlying Column objects.  Direct
Column objects such as Query(table.c.col) will
return the "key" attribute of the Column.
2008-08-05 20:15:28 +00:00
Mike Bayer d371637af0 - fixed endless loop bug which could occur
within a mapper's deferred load of
inherited attributes.
- declarative initialization of Columns adjusted so that
non-renamed columns initialize in the same way as a non
declarative mapper.   This allows an inheriting mapper
to set up its same-named "id" columns in particular
such that the parent "id" column is favored over the child
column, reducing database round trips when this value
is requested.
2008-08-04 15:21:29 +00:00
Mike Bayer edf6b16fae - compiler visit_label() checks a flag "within_order_by" and will render its own name
and not its contained expression, if the dialect reports true for supports_simple_order_by_label.
the flag is not propagated forwards, meant to closely mimic the syntax Postgres expects which is
that only a simple name can be in the ORDER BY, not a more complex expression or function call
with the label name embedded (mysql and sqlite support more complex expressions).

This further sets the standard for propigation of **kwargs within compiler, that we can't just send
**kwargs along blindly to each XXX.process() call; whenever a **kwarg needs to propagate through,
most methods will have to be aware of it and know when they should send it on forward and when not.
This was actually already the case with result_map as well.

The supports_simple_order_by dialect flag defaults to True but is conservatively explicitly set to
False on all dialects except SQLite/MySQL/Postgres to start.

[ticket:1068]
2008-08-03 21:19:32 +00:00
Mike Bayer 8df49e7194 descriptive error message raised when string-based relation() expressions inadvertently mistake a PropertyLoader for a ColumnLoader property 2008-08-03 18:39:53 +00:00
Mike Bayer 4769ea895b - renamed autoexpire to expire_on_commit
- renamed SessionTransaction autoflush to reentrant_flush to more clearly state its purpose
- added _enable_transaction_accounting, flag for Mike Bernson which disables the whole 0.5 transaction state management; the system depends on expiry on rollback in order to function.
2008-08-03 18:03:57 +00:00
Mike Bayer d28ba32271 - The "entity_name" feature of SQLAlchemy mappers
has been removed.  For rationale, see
http://groups.google.com/group/sqlalchemy/browse_thread/thread/9e23a0641a88b96d?hl=en
2008-08-02 22:21:42 +00:00
Mike Bayer c7eeea8a95 further refinement to the inheritance "descriptor" detection such that
local columns will still override superclass descriptors.
2008-08-01 17:13:31 +00:00
Mike Bayer 5d55eac6b6 test case to disprove [ticket:1126] 2008-08-01 15:10:36 +00:00
Mike Bayer 86126c98a2 - Fixed bug whereby the "unsaved, pending instance"
FlushError raised for a pending orphan would not take
superclass mappers into account when generating
the list of relations responsible for the error.
2008-07-31 16:41:41 +00:00
Mike Bayer 449b33e059 relation.order_by requires _literal_as_column conversion as well 2008-07-29 19:49:46 +00:00
Michael Trier c622a86286 Raised an error when sqlite version does not support default values. Addresses #909 in a purposeful way. 2008-07-29 03:08:38 +00:00
Mike Bayer e411a83783 added dummy column to correct results on sqlite 2008-07-26 21:40:36 +00:00
Jason Kirtland b403f156fe - func.count() with no argument emits COUNT(*) 2008-07-24 21:36:16 +00:00
Michael Trier 951fe224fa Corrected problem with detecting closed connections. Fixed issues in reflecttable for reflecting the mssql tables. Removed unicode reflection test from mssql. Need to investigate this further. 2008-07-23 05:10:04 +00:00
Mike Bayer cfb9bbde7d allow SQLA-defaults on table columns that are excluded in the mapper 2008-07-22 13:45:29 +00:00
Mike Bayer 59b25a513a - more accurate changelog message
- generalized the descriptor detection to any object with a __get__ attribute
2008-07-20 18:36:44 +00:00
Mike Bayer 419753f59b - An inheriting class can now override an attribute
inherited from the base class with a plain descriptor,
or exclude an inherited attribute via the
include_properties/exclude_properties collections.
2008-07-20 18:23:44 +00:00
Mike Bayer a4781e4d76 - A critical fix to dynamic relations allows the
"modified" history to be properly cleared after
a flush().
2008-07-19 21:33:58 +00:00
Mike Bayer d56862cbca - Some improvements to the _CompileOnAttr mechanism which
should reduce the probability of "Attribute x was
not replaced during compile" warnings. (this generally
applies to SQLA hackers, like Elixir devs).
2008-07-19 19:23:37 +00:00
Mike Bayer c5141f2981 - Class-bound attributes sent as arguments to
relation()'s remote_side and foreign_keys parameters
are now accepted, allowing them to be used with declarative.
2008-07-19 18:55:11 +00:00
Mike Bayer e78d06a4db - reverted r4955, that was wrong. The backref responsible for the operation is the one where the "cascade" option should take effect.
- can use None as a value for cascade.
- documented cascade options in docstring, [ticket:1064]
2008-07-19 18:18:50 +00:00
Mike Bayer 0cb0dc0694 zoomarks have gone up as a result of r4936, possibly others. not clear why 2008-07-18 22:28:16 +00:00
Mike Bayer 100c17229f - save-update and delete-orphan cascade event handler
now considers the cascade rules of the event initiator only, not the local
attribute.  This way the cascade of the initiator controls the behavior
regardless of backref events.
2008-07-18 22:11:22 +00:00
Mike Bayer 5e7f90a1d6 - Fixed a series of potential race conditions in
Session whereby asynchronous GC could remove unmodified,
no longer referenced items from the session as they were
present in a list of items to be processed, typically
during session.expunge_all() and dependent methods.
2008-07-18 17:42:11 +00:00
Mike Bayer 5af88c5df1 - MapperProperty gets its .key attribute assigned early, in _compile_property.
MapperProperty compilation is detected using a "_compiled" flag.
- A mapper which inherits from another, when inheriting
the columns of its inherited mapper, will use any
reassigned property names specified in that inheriting
mapper.  Previously, if "Base" had reassigned "base_id"
to the name "id", "SubBase(Base)" would still get
an attribute called "base_id".   This could be worked
around by explicitly stating the column in each
submapper as well but this is fairly unworkable
and also impossible when using declarative [ticket:1111].
2008-07-16 21:56:23 +00:00
Mike Bayer 0d9985588b added a new test illustrating a particular inheritance bug. will add ticket 2008-07-16 21:23:17 +00:00
Jason Kirtland a00b42b289 - mysql.MSEnum value literals now automatically quoted when used in a CREATE.
The change is backward compatible. Slight expansion of patch from catlee.
  Thanks! [ticket:1110]
2008-07-16 18:24:20 +00:00
Jason Kirtland b155b60280 - Spiffed up the deprecated decorators & @flipped 'em up top 2008-07-16 17:34:41 +00:00
Jason Kirtland 8b12c8f1c2 - Removed 2.3 Decimal compat 2008-07-15 19:40:08 +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 6917ffb9bd And thus ends support for Python 2.3. 2008-07-15 18:21:24 +00:00
Jason Kirtland 4fe4127958 - Fixed a couple lingering exceptions->exc usages
- Some import tidying
2008-07-15 16:39:27 +00:00
Mike Bayer deaff3e97f - Fixed bug when calling select([literal('foo')])
or select([bindparam('foo')]).
2008-07-15 15:04:43 +00:00
Mike Bayer af38982273 - Added a new SessionExtension hook called after_attach().
This is called at the point of attachment for objects
via add(), add_all(), delete(), and merge().
2008-07-15 14:54:37 +00:00
Mike Bayer 44aa875212 - The "allow_column_override" flag from mapper() has
been removed.  This flag is virtually always misunderstood.
Its specific functionality is available via the
include_properties/exclude_properties mapper arguments.
2008-07-14 20:04:35 +00:00
Mike Bayer 05b44779a7 2.4 support ! 2008-07-14 19:42:42 +00:00
Mike Bayer 45a2b0fedf possible fix for MS-SQL version of match() test, but the real solution here may be to have the correct default paramstyle set up on the MS-SQL dialect. 2008-07-14 19:39:50 +00:00
Mike Bayer 472215eef2 added a passing test for [ticket:1105] 2008-07-14 00:17:04 +00:00
Michael Trier f899157ca9 Added new basic match() operator that performs a full-text search. Supported on PostgreSQL, SQLite, MySQL, MS-SQL, and Oracle backends. 2008-07-13 04:45:37 +00:00
Jason Kirtland 8b6855fc2c Added default support to OrderedDict.pop [ticket:585] 2008-07-10 19:16:08 +00:00
Mike Bayer 5d375cd730 - Declarative supports a __table_args__ class variable, which
is either a dictionary, or tuple of the form
(arg1, arg2, ..., {kwarg1:value, ...}) which contains positional
+ kw arguments to be passed to the Table constructor.
[ticket:1096]
2008-07-09 20:38:35 +00:00
Mike Bayer e7e60c05c0 - SQLite Date, DateTime, and Time types only accept Python
datetime objects now, not strings.  If you'd like to format
dates as strings yourself with SQLite, use a String type.
If you'd like them to return datetime objects anyway despite
their accepting strings as input, make a TypeDecorator around
String - SQLA doesn't encourage this pattern.
2008-07-09 16:15:14 +00:00
Michael Trier 36e7efa4eb Fixed borked testlib due to r4901. 2008-07-08 02:48:13 +00:00
Michael Trier cec5947b5b Refactored the mock_engine in the tests so it's not duplicated in several places. Closes #1098 2008-07-08 01:37:38 +00:00
Mike Bayer 0f42004dee - session.refresh() raises an informative error message if
the list of attributes does not include any column-based
attributes.

- query() raises an informative error message if no columns
or mappers are specified.

- lazy loaders now trigger autoflush before proceeding.  This
allows expire() of a collection or scalar relation to
function properly in the context of autoflush.

- whitespace fix to new Table prefixes option
2008-07-05 20:37:44 +00:00
Mike Bayer cf9edea203 commented out bus erroring section for now pending [ticket:1099] resolution 2008-07-05 20:35:26 +00:00
Michael Trier 9d7c6901cb Added prefixes option to that accepts a list of string to insert after CREATE in the CREATE TABLE statement. Closes #1075. 2008-07-05 03:31:30 +00:00