root / elixir / trunk / CHANGES

Revision 534, 25.7 kB (checked in by ged, 12 months ago)

- Fixed bad foreign key constraint generated for classes inheriting from a

class with multiple primary keys when using the "multi" inheritance.
Patch from & closes #114.

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