root / elixir / trunk / CHANGES @ 448

Revision 448, 22.7 kB (checked in by ged, 4 years ago)

Fixed using to_dict with a ManyToOne relationship in the "deep" set and that
relationship being None in the entity being converted.

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