summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/declarative.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - relationships and columns with foreign keys aren'tMike Bayer2010-03-261-2/+11
| | | | allowed on declarative mixins, sorry. [ticket:1751]
* - Using @classdecorator and similar on mixins to defineMike Bayer2010-03-261-14/+15
| | | | | | __tablename__, __table_args__, etc. now works if the method references attributes on the ultimate subclass. [ticket:1749]
* - Using a mixin won't break if the mixin implements anMike Bayer2010-03-251-1/+1
| | | | | unpredictable __getattribute__(), i.e. Zope interfaces. [ticket:1746]
* - An exception is raised when a single-table subclass specifiesMike Bayer2010-03-191-0/+5
| | | | | a column that is already present on the base class. [ticket:1732]
* if anybody complains that they didn't know it was called "relation" in 0.5, ↵Mike Bayer2010-03-171-2/+5
| | | | why..I'll eat my hat !
* - The official name for the relation() function is nowMike Bayer2010-03-171-21/+21
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* fixes for some nasty edge cases when usng descriptors to compute special ↵Chris Withers2010-03-021-5/+16
| | | | attributes
* allow __tablename__ to come from a mixinChris Withers2010-03-011-0/+3
|
* - merge -r6823:6841 of branches/chrisw_mixinMike Bayer2010-02-251-158/+290
| | | | | | | | | | | | - declarative now accepts mixin classes directly, as a means to provide common functional and column-based elements on all subclasses, as well as a means to propagate a fixed set of __table_args__ or __mapper_args__ to subclasses. For custom combinations of __table_args__/__mapper_args__ from an inherited mixin to local, descriptors can now be used. New details are all up in the Declarative documentation. Thanks to Chris Withers for putting up with my strife on this. [ticket:1707]
* long linesMike Bayer2010-02-231-1/+3
|
* - a change to the previous __mapper_args__ commit.Mike Bayer2010-02-231-2/+5
| | | | | | | | - the __mapper_args__ dict is copied when propagating to a subclass, and is taken straight off the class __dict__ to avoid any propagation from the parent. mapper inheritance already propagates the things you want from the parent mapper. [ticket:1393]
* - the __mapper_args__ dict is copied when propagating to a subclass.Mike Bayer2010-02-231-1/+1
| | | | | Still need to decide how the argument propagation should work in the bigger picture. [ticket:1393]
* - DeclarativeMeta exclusively uses cls.__dict__ (not dict_)Mike Bayer2010-02-221-7/+8
| | | | | | | | as the source of class information; _as_declarative exclusively uses the dict_ passed to it as the source of class information (which when using DeclarativeMeta is cls.__dict__). This should in theory make it easier for custom metaclasses to modify the state passed into _as_declarative.
* for string deferred evals, don't return the underlying Column, rely upon the ↵Mike Bayer2010-01-291-5/+7
| | | | | | original propcomparator to do what it wants. reduces duplication of the "columns[0]" rule and removes potentially surprise behavior from the eval
* deprecations per [ticket:1498]:Mike Bayer2009-10-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - deprecated PassiveDefault - use DefaultClause. - the BINARY and MSBinary types now generate "BINARY" in all cases. Omitting the "length" parameter will generate "BINARY" with no length. Use BLOB to generate an unlengthed binary column. - the "quoting='quoted'" argument to MSEnum/ENUM is deprecated. It's best to rely upon the automatic quoting. - "shortname" attribute on bindparam() is removed. - fold_equivalents flag on join is deprecated (will remain until [ticket:1131] is implemented) - "scalar" flag on select() is removed, use select.as_scalar(). - 'transactional' flag on sessionmaker() and others is removed. Use 'autocommit=True' to indicate 'transactional=False'. - 'polymorphic_fetch' argument on mapper() is removed. Loading can be controlled using the 'with_polymorphic' option. - 'select_table' argument on mapper() is removed. Use 'with_polymorphic=("*", <some selectable>)' for this functionality. - 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the "proxy generation" behavior is now automatic. - Passing a single list of elements to eagerload(), eagerload_all(), contains_eager(), lazyload(), defer(), and undefer() instead of multiple positional -args is deprecated. - Passing a single list of elements to query.order_by(), query.group_by(), query.join(), or query.outerjoin() instead of multiple positional *args is deprecated. - query.iterate_instances() is removed. Use query.instances(). - Query.query_from_parent() is removed. Use the sqlalchemy.orm.with_parent() function to produce a "parent" clause, or alternatively query.with_parent(). - query._from_self() is removed, use query.from_self() instead. - the "comparator" argument to composite() is removed. Use "comparator_factory". - RelationProperty._get_join() is removed. - the 'echo_uow' flag on Session is removed. Use logging on the "sqlalchemy.orm.unitofwork" name. - session.clear() is removed. use session.expunge_all(). - session.save(), session.update(), session.save_or_update() are removed. Use session.add() and session.add_all(). - the "objects" flag on session.flush() remains deprecated. - the "dont_load=True" flag on session.merge() is deprecated in favor of "load=False". - passing an InstanceState (internal SQLAlchemy state object) to attributes.init_collection() or attributes.get_history() is deprecated. These functions are public API and normally expect a regular mapped object instance. - the 'engine' parameter to declarative_base() is removed. Use the 'bind' keyword argument.
* - the mechanics of "backref" have been fully merged into theMike Bayer2009-10-051-3/+4
| | | | | | | | | | finer grained "back_populates" system, and take place entirely within the _generate_backref() method of RelationProperty. This makes the initialization procedure of RelationProperty simpler and allows easier propagation of settings (such as from subclasses of RelationProperty) into the reverse reference. The internal BackRef() is gone and backref() returns a plain tuple that is understood by RelationProperty.
* merge from branches/clauseelement-nonzeroPhilip Jenvey2009-09-241-3/+3
| | | | | | adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash collisions (which only occur on Jython) fixes #1547
* - Table objects declared in the MetaData can now be usedMike Bayer2009-09-121-2/+4
| | | | | | in string expressions sent to primaryjoin/secondaryjoin/ secondary - the name is pulled from the MetaData of the declarative base. [ticket:1527]
* merge 0.6 series to trunk.Mike Bayer2009-08-061-1/+1
|
* - Declarative will raise an informative exception ifMike Bayer2009-07-251-15/+30
| | | | | __table_args__ is passed as a tuple with no dict argument. Improved documentation. [ticket:1468]
* Fixed adding of deferred or othe column properties to a declarative class.Michael Trier2009-04-181-0/+6
|
* - Declarative will accept a table-bound column as a propertyMike Bayer2009-02-221-1/+3
| | | | | | 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.
* - Declarative locates the "inherits" class using a searchMike Bayer2009-02-191-4/+5
| | | | | through __bases__, to skip over mixins that are local to subclasses.
* - Declarative will properly interpret the "foreign_keys" argumentMike Bayer2009-02-171-1/+1
| | | | on a backref() if it's a string.
* - Declarative figures out joined-table inheritance primary joinMike Bayer2009-02-161-8/+8
| | | | | | condition even if "inherits" mapper argument is given explicitly. Allows mixins to be used with joined table inheritance.
* prefer this methodsMike Bayer2009-01-131-1/+0
|
* - It's an error to add new Column objects to a declarative classMike Bayer2009-01-131-2/+4
| | | | that specified an existing table using __table__.
* - Column with no name (as in declarative) won't raise aMike Bayer2009-01-131-0/+1
| | | | | NoneType error when it's string output is requsted (such as in a stack trace).
* - Can now specify Column objects on subclasses which have noMike Bayer2009-01-121-49/+214
| | | | | | | | | | | | | | | | | | | | | table of their own (i.e. use single table inheritance). The columns will be appended to the base table, but only mapped by the subclass. - For both joined and single inheriting subclasses, the subclass will only map those columns which are already mapped on the superclass and those explicit on the subclass. Other columns that are present on the `Table` will be excluded from the mapping by default, which can be disabled by passing a blank `exclude_properties` collection to the `__mapper_args__`. This is so that single-inheriting classes which define their own columns are the only classes to map those columns. The effect is actually a more organized mapping than you'd normally get with explicit `mapper()` calls unless you set up the `exclude_properties` arguments explicitly. - docs/tests
* - 0.5.1 bumpMike Bayer2009-01-111-0/+4
| | | | | - modernized mapper()/no table exception - added __tablename__ exception to declarative since ppl keep complaining
* - fixed string-based "remote_side", "order_by" andMike Bayer2008-12-111-1/+1
| | | | | others not propagating correctly when used in backref().
* fix typosMike Bayer2008-12-081-3/+3
|
* - removed redundant declarative docsMike Bayer2008-12-081-33/+69
| | | | - cleanup of metadata/foreignkey docs
* - merged -r5338:5429 of sphinx branch.Mike Bayer2008-12-061-2/+2
| | | | | | | | | | | | | - Documentation has been converted to Sphinx. In particular, the generated API documentation has been constructed into a full blown "API Reference" section which organizes editorial documentation combined with generated docstrings. Cross linking between sections and API docs are vastly improved, a javascript-powered search feature is provided, and a full index of all classes, functions and members is provided.
* - Can now use a custom "inherit_condition" inMike Bayer2008-11-121-1/+1
| | | | __mapper_args__ when using declarative.
* Documented synonym_for and comparable_using in the main docstring for ↵Michael Trier2008-10-051-0/+24
| | | | declarative. Fixes #1144.
* fix up element sorting in declarativeMike Bayer2008-09-191-2/+1
|
* - Fixed exception throw which would occur when string-basedMike Bayer2008-09-041-0/+6
| | | | primaryjoin condition was used in conjunction with backref.
* - fixed endless loop bug which could occurMike Bayer2008-08-041-0/+7
| | | | | | | | | | | | 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.
* some doc stuffMike Bayer2008-08-041-1/+1
|
* descriptive error message raised when string-based relation() expressions ↵Mike Bayer2008-08-031-1/+4
| | | | inadvertently mistake a PropertyLoader for a ColumnLoader property
* - Refactored declarative_base() as a thin wrapper over type()Jason Kirtland2008-08-021-27/+54
| | | | | | - The supplied __init__ is now optional - The name of the generated class can be specified - Accepts multiple bases
* - declarative.declarative_base():Jason Kirtland2008-08-021-4/+38
| | | | | | takes a 'metaclass' arg, defaulting to DeclarativeMeta renamed 'engine' arg to 'bind', backward compat documented
* Corrected a couple of lingering transactional=True statements in the docs.Michael Trier2008-07-191-1/+1
|
* typoGaëtan de Menten2008-07-111-1/+1
|
* - Declarative supports a __table_args__ class variable, whichMike Bayer2008-07-091-7/+25
| | | | | | | 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]
* - added "CALL" to Mysql select keywordsMike Bayer2008-05-271-1/+1
| | | | - NameError doesn't have "message" in py2.4
* added string argument resolution to relation() in conjunction with ↵Mike Bayer2008-05-261-15/+54
| | | | | | declarative for: order_by, primaryjoin, secondaryjoin, secondary, foreign_keys, and remote_side.
* - renamed query.slice_() to query.slice()Mike Bayer2008-05-131-69/+83
| | | | | | - pulled out DeclarativeMeta.__init__ into its own function, added instrument_declarative() which will do the "declarative" thing to any class independent of its lineage (for ctheune) - added "cls" kwarg to declarative_base() allowing user-defined base class for declarative base [ticket:1042]
* Removed declared_synonym(), pep-8 clean ups.Jason Kirtland2008-05-131-78/+82
|