Commit Graph

3806 Commits

Author SHA1 Message Date
Michael Trier 045d0d63ea Corrected problem in docstring. rel_0_5beta3 2008-08-04 19:53:04 +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
Lele Gaifax 28ff190475 Typo 2008-08-04 13:17:40 +00:00
Mike Bayer e53339cf74 some doc stuff 2008-08-04 03:05:26 +00:00
Mike Bayer 18a4912f77 removed redundant check to _enable_transaction_accounting 2008-08-03 21:35:44 +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 312647647d a correction to the recent should_exclude change. should_exclude is a little mixed
up as to when it honors "column_prefix" and when it doesn't, depending on whether or not
the prop is coming from a column name or from an inherited class.  Will need more testing
to uncover potential issues here.
2008-08-03 16:52:31 +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
Jason Kirtland 19bc91c757 - Refactored declarative_base() as a thin wrapper over type()
- The supplied __init__ is now optional
- The name of the generated class can be specified
- Accepts multiple bases
2008-08-02 17:07:33 +00:00
Jason Kirtland 8c261ab7b7 - declarative.declarative_base():
takes a 'metaclass' arg, defaulting to DeclarativeMeta
  renamed 'engine' arg to 'bind', backward compat
  documented
2008-08-02 16:32:02 +00:00
Jonathan Ellis 72a4e6b265 make ProxyImpl a top-level class (this makes it importable by FormAlchemy, making reverse-engineering synonyms a bit easier) 2008-08-01 23:02:02 +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 2cb79b9808 added MutableType, Concatenable to __all__ 2008-07-31 16:48:32 +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
Gaëtan de Menten fd51706903 typo 2008-07-29 08:43:30 +00:00
Michael Trier bdbf3e302a Corrects reflecttable in firebird database. Closes #1119. 2008-07-29 03:17:02 +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
Michael Trier 5c75aed9be Corrected a couple of lingering transactional=True statements in the docs. 2008-07-19 17:52:31 +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 437dd22d49 Removed deprecated get_version_info, use server_version_info 2008-07-16 15:25:33 +00:00
Jason Kirtland bb784c8244 - Overhauled _generative and starargs decorators and flipped to 2.4 @syntax 2008-07-16 06:47:22 +00:00
Jason Kirtland 8b169bdc1a - Fixed some over-long ReST lines & general formatting touchups 2008-07-15 22:01:15 +00:00
Jason Kirtland 5f8554f0de Completed engine_descriptors() removal (started in r4900) 2008-07-15 21:50:48 +00:00
Jason Kirtland 38f982c022 - Moved to 2.4+ import syntax (w/ some experimental merge-friendly formatting) 2008-07-15 21:43:02 +00:00
Jason Kirtland 3da6297d78 Whitespace tweaks suggested by pep8.py 2008-07-15 20:20:41 +00:00
Jason Kirtland 901d76beba - Removed the last of the 2.3 dict compat & some formatting tweaks. 2008-07-15 20:06:56 +00:00
Jason Kirtland acbfb9ea2b - Always use native threading.local (or the native dummy version) 2008-07-15 19:56:30 +00:00
Jason Kirtland 4f56fd23bc - Always use native itemgetter & attrgetter 2008-07-15 19:53:17 +00:00
Jason Kirtland 4eb747b61f - Always use native deque 2008-07-15 19:46:24 +00:00
Jason Kirtland 8b12c8f1c2 - Removed 2.3 Decimal compat 2008-07-15 19:40:08 +00:00