root / elixir / tags / 0.7.0 / CHANGES

Revision 486, 24.1 kB (checked in by ged, 5 years ago)

release time, yay!

10.7.0 - 2009-10-01
3Please see for detailed
4upgrade notes. If you are upgrading an application with existing data from an
5earlier version of Elixir, you are STRONGLY ADVISED to read them!
7New features:
8- Added a new statement 'using_options_defaults' which can be used
9  on a custom base class to set default values for the options of all its
10  subclasses. For example, this makes it possible to have all classes
11  inheriting from your custom base class use some custom options without
12  having to set it individually on each entity, nor modify
13  options.options_defaults.
14- The local_colname and remote_colname arguments on ManyToMany relationships
15  can now also be used to set custom names for the ManyToMany table columns.
16  This effectively replace the column_format on ManyToMany relationships which
17  is now deprecated. Change based on a patch from Diez B. Roggisch.
18- Added (or rather fixed and documented) a "table" argument on ManyToMany
19  relationships to allow using a manually-defined Table (closes #44).
20- Added a "schema" argument on ManyToMany relationships to be able to create
21  the ManyToMany table in a custom schema and not necessarily the same schema
22  as the table of the "source" entity (patch from Diez B. Roggisch).
23- Added a "table_kwargs" argument on ManyToMany relationships to pass any
24  extra keyword arguments to the underlying Table object (closes #94).
25- Added a new "target_column" argument on ManyToOne relationships so that you
26  can target unique but non-primary key columns. At the moment, this only works
27  if the target column is declared before the ManyToOne (see ticket #26).
28- Added new "column_names" argument to the acts_as_versioned extension,
29  allowing to specify custom column names (inspired by a patch by
30  Alex Bodnaru).
31- Made M2MCOL_NAMEFORMAT option accept a callable, so that more complex naming
32  generation can be used if so desired.
33- Added two new extensions (contributed by Alex Bodnaru)
34  - "perform_ddl" allows to execute one or several DDL statements upon table
35    creation.
36  - "preload_data" allows to insert data into the entity table just after it
37    has been created.
38- EntityCollection gained a working extend method
41- Moved class instrumentation to a separate function: instrument_class
42- Moved all methods of the "Entity" base class, to the "EntityBase" class, so
43  that people who want to provide their own base class but don't want to loose
44  all the methods provided by "Entity" can simply inherit from EntityBase
45  instead of copy-pasting the code for all its methods.
46- Renamed remote_side and local_side ManyToMany arguments to remote_colname and
47  local_colname respectively to not collide with the remote_side argument
48  provided by SA (it doesn't make much sense on ManyToMany relationships but
49  still).
50- Delete Elixir properties in the setup phase rather than as soon as they are
51  attached to their class. It makes it possible to access them or refer to them
52  after the class is defined (but before setup).
53- Deprecated act_as_list extension in favor of SQLAlchemy's orderinglist
54  extension (closes #53).
55- Made manually defined mapper options take precedence over Elixir-generated
56  ones. Not very useful yet since most are expecting Column objects.
57- Default table_options (defined in options_defaults['table_options']) are now
58  also used for ManyToMany tables (closes #94).
59- Provide our own Session.mapper equivalent to avoid SQLAlchemy 0.5.5+
60  deprecation warning. This mapper autosave object instances on __init__ unless
61  save_on_init=False is passed as a mapper argument (closes #92).
63Bug fixes:
64- Fixed Elixir to work with the future SQLAlchemy 0.6 (trunk as of 6377).
65- Changed the pattern used by default to generate column names for
66  self-referencial ManyToMany relationships so that the meaning of
67  bidirectional self-referential relationships does not depend on the order of
68  declaration of each side (closes #69). See upgrade notes for details.
69- Changed slightly the pattern used to generate the name of the table for
70  bidirectional self-referential ManyToMany relationships so that it doesn't
71  depend on the order of declaration of each side (closes #19).
72  See upgrade notes for details.
73- default EntityCollection raise an exception instead of returning None when
74  trying to resolve an inexisting Entity from outside of another entity (for
75  example through EntityCollection.__getattr__
76- Fixed the case where you specify both "primaryjoin" and "colname" arguments
77  (useless in this case, but harmless) on a ManyToOne relationship of an
78  autoloaded entity.
79- Fixed bug which broke the "identity" (Entity) option
80- Fixed documentation about local_side and remote_side arguments being
81  required if the entity containing the relationship is autoloaded, when it is
82  only required if the relationship is self-referencial, and primaryjoin or
83  secondaryjoin as not been specified manually.
84- Added missing documentation for the "filter" argument on OneToMany
85  relationships.
86- Fixed the act_as_list extension's move_to_bottom method to work on MySQL
87  (closes #34).
88- Fixed event methods not being called when they are defined on a parent class.
89  (introduced in release 0.5.0).
90- Added workaround for an odd mod_python behavior (class.__module__ returns a
91  weird name which is not in sys.modules).
92- tablename, remote_colname, local_colname, schema and table_kwargs can now be
93  defined on either side of a ManyToMany relationship and will propagate to
94  the other side if that other side doesn't specify anything for that argument.
95  Also added an assertion to catch the case where the same/mirror
96  argument is specified on both sides but with different values.
97- Fixed filter argument on OneToMany relationship leaking the filter to the
98  unfiltered relationship.
99- Fixed encrypted extension to not encrypt several times an instance attributes
100  when that instance is flushed several times before being expunged from the
101  session.
102- Fixed using to_dict with a ManyToOne relationship in the "deep" set and that
103  relationship being None in the entity being converted.
1050.6.1 - 2008-08-18
107New features:
108- Allow ManyToOne relationships to use manually created fields as their
109  "supporting column". This means that the columns can be customized without
110  resorting to using the ugly "column_kwargs" (patch from Jason R. Coombs,
111  closes #39).
112- Extra args and kwargs to Synonym and ColumnProperty are forwarded to their
113  underlying constructs. This allows for example deferred ColumnProperties.
114- Added a more helpful assertion message when inverse relationship types don't
115  match.
118- Removed support for the deprecated "with_fields" syntax
119- Entity.__init__ calls Entity.set instead of duplicating its functionality
121Bug fixes:
122- Fixed the "Target resolves to several entities" exception message to actually
123  include the target name.
124- Renamed the on_reconstitute method decorator to reconstructor, to track the
125  corresponding change in SA's trunk.
1270.6.0 - 2008-07-18
129Please see for detailed
130upgrade notes.
132New features:
133- Fields in a custom base class are added to all their children.
134- Added two new methods on the base entity: from_dict and to_dict, which can
135  be used to create (or output) a whole hierarchy of instances from (to) a
136  simple JSON-like dictionary notation (patch from Paul Johnston,
137  closes ticket #40).
138- Added experimental (!) support for concrete table inheritance (both
139  polymorphic or not). Concrete polymorphic inheritance requires SQLAlchemy
140  0.4.5 or later.
141- Moved the "entity to string" mapping and resolving code to the (newly
142  created) EntityCollection class (which stores lists of entities). This
143  allows one to provide a custom mapping method if needed. The default class
144  also overrides the __getattr__ method, providing and handy way to get at your
145  entities. See
146- Added new "identity" option which can be used to set a custom polymorphic
147  identity for an entity. It also accepts a callable so that you can generate
148  the identity name automatically from the class itself.
149- Added __setattr__ method on Metaclass so that you can add properties
150  slightly more easily after class definition (but *before* setup_all):
151    class A(Entity):
152        pass
153 = Field(String(32))
154- Added add_table_column, add_mapper_property and add_mapper_extension helper
155  methods in EntityBuilders.
156- Added full_tablename property on EntityDescriptor (includes schema name if
157  any).
158- Added on_reconstitute event/method decorator. Only works with SA 0.5.
159- Added support for viewonly relationships (OneToMany and OneToOne).
160- Added support for filtered OneToMany relationships. Produce viewonly
161  relations. See
162  for an example.
163- Added support for callables for some arguments on relationships: primaryjoin,
164  secondaryjoin and remote_side. It means those can be evaluated at setup time
165  (when tables and their columns already exist) instead of definition time.
168- Default "target entity resolving code" changed slightly. It now uses a global
169  collection keyed on the entity name. This means that entities can refer to
170  other entities in a different module simply with the target entity name
171  instead of its full path. The full path is only required when there is an
172  ambiguity (ie when there are two classes with the same name in two different
173  modules). Closes #9.
174- Added support for SQLAlchemy 0.5, and dropped support for version 0.3 and
175  earlier.
176- The default session (elixir.session) uses sessionmaker() instead of
177  create_session(), which means it has now the following characteristics:
178    * autoflush=True
179    * autocommit=False (with SA 0.5 -- equivalent to transactional=True with
180      SA 0.4)
181    * autoexpire=True (with SA 0.5).
182- removed objectstore and other SA 0.3 (or older) support code.
184Bug fixes:
185- Fixed multi-table inheritance when using a non default schema (closes #38)
186- Fixed ManyToOne relationships using 'key' kwarg in their column_kwargs
187  (patch by Jason R. Coombs)
188- Fixed inheritance with autoloaded entities: when using autoload, we
189  shouldn't try to add columns to the table (closes tickets #41 and #43).
190- Fixed acts_as_list extension with autoloaded entities (patch from maqr,
191  closes ticket #52).
192- Fixed ColumnProperty to work with latest version of SQLAlchemy (O.4.5 and
193  later)
194- Fixed ManyToMany relationships when not using the default schema
195  (patch from Diez B. Roggisch, closes ticket #48)
198- Added AUTHORS list. If you are missing from this list, don't hesitate to
199  contact me.
2010.5.2 - 2008-03-28
203New features:
204- Added an optional `check_concurrency` keyword argument to the versioning
205  extension, supporting the usage of SQLAlchemy's built-in optimistic
206  concurrency check.
209- Made Elixir python 2.3 compatible again (based on patches from
210  Jason R. Coombs)
212Bug fixes:
213- Fixed act_as_list extension to work with DBMS that require subselects to be
214  aliased (patch by Alice McGregor)
215- Fixed the versioning extension so that the history table is updated within
216  the current transaction (patch from and closes ticket #35).
2180.5.1 - 2008-02-07
220New features:
221- Added a new elixir plugin for managing entities as (ordered) lists.
222- Added a `column_format` keyword argument to `ManyToMany` which can be used
223  to specify an alternate format string for column names in the mapping table.
224- Added support for custom base classes which inherit from another class (ie
225  not directly from object).
226- Added an alternate (nicer) syntax to define synonym properties.  This syntax
227  has a more limited scope, except that it can refer to properties defined in
228  a parent entity. This is based on a patch from Alexandre da Silva.
231- Added check so that using an inexisting column in an order_by or other
232  column-name based argument raises an exception.
233- The polymorphic_identity kwarg in using_mapper_options is not overriden
234  anymore by the one generated by Elixir (patch from Ben Bangert).
235- Moved the format of the multi-table inheritance column to a constant in
236  options (so that it can be changed globally).
237- The foreign key constraint of the column in a multi-table inheritance is
238  configured with a cascade rule.
240Bug fixes:
241- A child entity doesn't inherit anymore its parent entity statements (such as
242  options) if it doesn't use any statement itself.
243- Made inheritance work for custom base classes (closes #25).
244- Fixed the inverse relationship matching when the inverse relationship is
245  defined in a parent Entity (thanks to Alexandre da Silva).
246- Fixed bug in setup_entities (it always used the global entity list and not
247  the list given as argument).
248- Fixed the versioning extension not appropriately handling versioned
249  entities with onupdate events (patch from Remi Jolin, closes #29).
250- Fixed videostore example (patch from Jason R. Coombs, closes #31).
2520.5.0 - 2007-12-08
254Please see for detailed
255upgrade notes.
257New features:
258- Added set method on base Entity (set attributes using kwargs)
261- Autosetup defaults to False ! (please look at those upgrade notes!)
262- Polymorphic defaults to True (inheritance is polymorphic by default).
263- Removed one of the autosetup triggers altogether: there is no "fake" mapper
264  registered in SQLAlchemy's mapper_registry anymore, so if you try to
265  access the class mapper directly (not through the 'mapper' attribute on
266  the class), before the setup phase happens, it won't work. This was done
267  because of a change in SQLAlchemy trunk (future SA 0.4.2) which broke that
268  piece of code (and prevented to use autosetup at all). Since that code
269  was a hack in the first place, instead of doing some even uglier hackery,
270  I got rid of it altogether.
271- Moved some format strings to constants in options, so that one can change
272  them if he wants to.
273- Allow overriding primary_key columns on autoloaded entities (closes tickets
274  #20 and #22)
275- Columns created by ManyToOne relationships can now optionally (through
276  column_kwargs) *not* create an index (ie it's not harcoded anymore).
277  Suggestion by Jason R. Coombs.
279Bug fixes:
280- Fixed a nasty bug which prevented inheritance to work correctly when using
281  the attribute syntax in many cases.
282- Fixed associable extension to work with SQLAlchemy trunk (future 0.4.2).
283- Fixed an incompatibility with zope.interfaces.
284- Tweaked the initialization sequence again (in fact revert an older change)
285  which prevented to reuse class properties of one class in other (subsequent)
286  classes.
287- Fixed our tests to work with SA trunk (future 0.4.2) (unicode data + use of
288  deprecated attributes)
2900.4.0 - 2007-10-29
292Please see for detailed
293upgrade notes.
295New features:
296- Implemented a new syntax to declare fields and relationships, much closer to
297  what is found in other Python ORM's. The with_fields syntax is now
298  deprecated in favor of a that new syntax. The old statement based (has_field
299  et al.) syntax is still available though (and will remain so for quite some
300  time). This was done with help from a patch by Adam Gomaa.
301- Implemented polymorphic single-table inheritance as well as polymorphic and
302  non-polymorphic multi-table (aka joined table) inheritance.
303- Added ext sub-package for additional Elixir statements.
304- Added associable extension for generating polymorphic associations with
305  Elixir statements.
306- Added versioning extension to keep track to all changes to your entities by
307  storing them in a secondary table.
308- Added encryption extenstion to encrypt/decrypt some fields data on the fly
309  when writing to/reading from the database.
310- Added support for synonym properties.
311- Added shortcut syntax to define column_properties.
312- Added a .query attribute on all entities. The old .query() syntax is still
313  available.
314- Added support to add any SQLAlchemy property on your mapper, through the
315  GenericProperty class (as well as the has_property statement). These can
316  work even if they rely on the entity columns (an thus need them to be
317  defined before the property can be declared). See tests/
318  for examples.
319- Added support for "manual session management" (ie you can now define an
320  entity with "using_options(session=None)" and it won't use any
321  SessionContext extension, nor receive the "query" attribute.
322- Made the statement system more powerfull.
325- The setup time was changed. That is the table and mapper are not created as
326  soon as the class is defined, but rather when first used, or when explicitly
327  calling the setup function (recommended). This also allowed us to reorder
328  the setup process and allows, among others to use a ManyToOne-generated
329  column as a primary key, to use unique constraints on those columns, to
330  order by those columns and so on...
331- Made Elixir work with both SQLAlchemy 0.4 and 0.3.10 (with help from a patch
332  by Ants Aasma).
333- Moved away from assign_mapper, now all assign_mapper-provided methods are on
334  the Entity class. Now, if people don't like them, they have the option to
335  simply provide another base class.
336- Default objectstore is now a ScopedSession when working on SQLAlchemy 0.4.
337  It means that it's not wrapped in an Objectstore object at all. This means,
338  that depending on the version of SA you are using, you'll get a slightly
339  different behavior.
340- Relationships to other classes can now also be defined using the classes
341  themselves in addition to the class namees. Obviously, this doesn't work for
342  forward references.
343- Classes defined inside a function can now have relationships to each other.
344- Added default __init__ method on entities so that subclasses can override it
345  and still have the "set attribute by keyword" behavior by calling super()
346- Added "through" and "via" keyword arguments on relationships and has_field
347  statement, to proxy values through relationships (uses association_proxy)
348- Made EntityMeta public, so that people can actually define their own base
349  class.
350- Changed the order of relationship kwargs processing so that computed kwargs
351  can be overridden by kwargs manually passed to the statement. This should
352  only be used if you know what you are doing.
353- Added onupdate kwarg to BelongsTo relationships for consistency with the
354  ondelete kwarg
355- Added ondelete and onupdate kwargs for use with has_and_belongs_to_many
356  to apply on delete clauses to foreign key constraints on the m2m table.
357- Columns of the intermediary table of an has_and_belongs_to_many relationship
358  are now marked as primary keys.
359- Reworked how entities look for primary keys on related entities. This
360  enables one "normal" entity (fully defined in Elixir) to refer to an entity
361  which is autoloaded.
362- Added translation (from column name to column object) of the primary_key
363  mapper option so that it can actually be used. This allows to have entities
364  without any primary key defined at the table level.
365- Added the possibility to give a custom name for ManyToOne constraints
366  (patch from and closes ticket #16)
367- Dropped support for the old threadlocal SA extension (which doesn't even exist
368  anymore in SA 0.4)
370Bug fixes:
371- Reworked/cleaned tests so that they don't leak stuff to other tests (both at
372  the method level and module level) anymore. Uses nosetest's module level
373  fixture.
374- Fixed relationships to entities whose primary_key field has been defined
375  with a "key" argument (based on a patch by Paul Johnston).
376- Fixed some buggy tests.
377- Fixed relationships to tables using a schema (patch by Neil Blakey-Milner)
378- Made inverse relationships use backrefs. This fixes the "bidirectional
379  coherency" problem some people had before doing a flush. (based on a patch
380  from Remi Jolin).
3820.3.0 - 2007-03-27
383- Made the provided metadata not threadlocal. This could break things for you
384  in some rare case. Please see the (newly created) FAQ file for details about
385  this.
386- Added support for autoloading/reflecting databases with
387  has_and_belongs_to_many relationships. The tablename argument is now
388  optional, but still recommended, otherwise you'll have to use the same exact
389  name for your intermediary table than the one generated. You also _have to_
390  specify at least one of either local_side or remote_side argument.
391- Added support for the "version_id_col" option on entities. This option adds
392  a column to the table which will be used to prevent concurrent modifications
393  on any row of the entity's table (i.e. it will raise an error if it happens).
394- Made the colname argument optional for belongs_to relationships in
395  autoloaded entities. It is only required to specify it if you have several
396  belongs_to relationships between two entities/tables.
397- Applied patch from "Wavy" so that columns of a table are in the same order
398  as they were declared (this only works for the has_field statement).
399- Applied patch from Isaac Csandl to add an "ondelete" argument to
400  belongs_to relationships. The content of that argument is forwarded to the
401  foreign key constraint.
402- Foreign key names generated by belongs_to relationships use column names
403  instead of relation names in case we have a relation with the same name
404  defined in several entities inheriting from the same entity using single-
405  table inheritance (and we set a custom column name in one of them to avoid
406  a column-name conflict).
407- Using invalid options on entities will now raise an exception
408- Added __version__
409- Use an explicit metaclass for entities, so that people can define their own
410  base class.
411- Changed the approach to reflecting/autoloading belongs_to relationships.
412  This shouldn't change anything to how it's used but allowed me to factor
413  some code with has_and_belongs_to_many relationships.
414- The tablename option can now be given a callable so that people can provide
415  their own function to get the table name for an entity. The tablename option
416  can now also be set globally (using the options_defaults dictionary). Of
417  course, this only makes sense for the callable usecase.
419- Fixed bug preventing having entities without any statement.
420- Fixed documentation for belongs_to relationships (the arguemnt is "required",
421  not "nullable").
422- Fixed typo which broke the use_alter argument on belongs_to relationships.
423- Fixed inheritance unit test to pass SQLAlchemy type check on relations
424  (introduced in SA 0.3.6)
425- Fixed wrong field length in autoload test (it was not noticeable with sqlite).
426- Actually make the code python 2.3 compatible (Robin's patch was based on
427  0.1.0 while I had introduced more decorators in the trunk in the mean time).
429- Made some PEP8 tweaks in many places. Used the pep8 script provided with
430  Cheesecake.
431- Some cleanup/useless code removal
4330.2.0 - 2007-02-28
434- Applied patch from Robin Munn to make the code python 2.3 compatible
435- Per a suggestion on the mailing list, look at the calling stack frame to
436  ensure that we apply statements to the proper class.  We now attach the
437  statement list to the class itself, rather than attaching it to a global
438  list that is neither threadsafe, nor safe when doing nested class
439  definition.  Also added a test to validate that this works.
440- implemented singletable non-polymorphic inheritance
441- added support to pass non-keyword arguments to tables. You just pass
442  them to the using_table_options statement and they will be forwarded to the
443  table along with the keyword arguments. This can be used to set table
444  constraints.
445- added support for deferred columns (use the "deferred" keyword argument on
446  fields)
447- added a "required" keyword argument on fields and BelongsTo
448  relationships. This is the opposite of the "nullable" SA argument.
449- added a "column_kwargs" keyword argument to BelongsTo relationships
450  to forward any keyword argument directly to the SA Column.
451- added support for the use_alter and constraint_kwargs kwargs on BelongsTo
452  relationships (forwarded to SA ForeignKeyConstraint).
453    -> removed the systematic use_alter on BelongsTo relations since it
454       can now be specified only when needed.
455    -> removed it from HasAndBelongsToMany relations, since I think a
456       circular foreign key dependency can't happen with those relations.
457- fixed foreign key names on MySQL (and possibly other) databases by
458  making sure the generated name is unique for the whole database, and not
459  only for the table on which it applies.
460- corrected some docstrings
4620.1.0 - 2007-02-12
463initial release
Note: See TracBrowser for help on using the browser.