root / elixir / trunk / CHANGES @ 362

Revision 362, 16.3 kB (checked in by ged, 5 years ago)
  • Added support for callables for some arguments on relationships:
    primaryjoin, secondaryjoin and remote_side. It means those can be evaluated
    at setup time (when tables and their columns already exist) instead of
    definition time (closes #50).
  • Misc cleanup
Line 
10.6.0
2
3New features:
4- Added two new methods on the base entity: from_dict and to_dict, which can
5  be used to create (or output) a whole hierarchy of instances from (to) a
6  simple JSON-like dictionary notation (patch from Paul Johnston,
7  closes ticket #40).
8- Added experimental (!) support for concrete table inheritance (both
9  polymorphic or not). Concrete polymorphic inheritance requires SQLalchemy
10  0.4.5 or later.
11- Added new "identity" option which can be used to set a custom polymorphic
12  identity for an entity. It also accepts a callable so that you can generate
13  the identity name automatically from the class itself.
14- Added __setattr__ method on Metaclass so that you can add properties
15  slightly more easily after class definition (but *before* setup_all):
16    class A(Entity):
17        pass
18    A.name = Field(String(32))
19- Added add_table_column, add_mapper_property and add_mapper_extension helper
20  methods in EntityBuilders.
21- Added full_tablename property on EntityDescriptor (includes schema name if
22  any).
23- Added on_reconstitute event/method decorator. Only works with SA 0.5.
24- Added support for viewonly relationships (OneToMany and OneToOne).
25- Added support for filtered OneToMany relationships. Produce viewonly
26  relations. See source:elixir/trunk/tests/test_o2m.py for an example.
27- Added support for callables for some arguments on relationships: primaryjoin,
28  secondaryjoin and remote_side. It means those can be evaluated at setup time
29  (when tables and their columns already exist) instead of definition time.
30
31Changes:
32- Added support for SQLAlchemy 0.5, and dropped support for version 0.3 and
33  earlier.
34- The default session (elixir.session) uses sessionmaker() instead of
35  create_session(), which means it has now the following characterisics:
36    * autoflush=True
37    * autocommit=False (with SA 0.5 -- equivalent to transactional=True with
38      SA 0.4)
39    * autoexpire=True (with SA 0.5).
40- removed objectstore and other SA 0.3 (or older) support code.
41
42Bug fixes:
43- Fixed multi-table inheritance when using a non default schema (closes #38)
44- Fixed ManyToOne relationships using 'key' kwarg in their column_kwargs
45  (patch by Jason R. Coombs)
46- Fixed inheritance with autoloaded entities: when using autoload, we
47  shouldn't try to add columns to the table (closes tickets #41 and #43).
48- Fixed acts_as_list extension with autoloaded entities (patch from maqr,
49  closes ticket #52).
50- Fixed ColumnProperty to work with latest version of SQLAlchemy (O.4.5 and
51  later)
52- Fixed ManyToMany relationships when not using the default schema
53  (patch from Diez B. Roggisch, closes ticket #48)
54
55Misc:
56- Added AUTHORS list. If you are missing from this list, don't hesitate to
57  contact me.
58
590.5.2 - 2008-03-28
60
61New features:
62- Added an optional `check_concurrency` keyword argument to the versioning
63  extension, supporting the usage of SQLAlchemy's built-in optimistic
64  concurrency check.
65
66Changes:
67- Made Elixir python 2.3 compatible again (based on patches from
68  Jason R. Coombs)
69
70Bug fixes:
71- Fixed act_as_list extension to work with DBMS that require subselects to be
72  aliased (patch by Alice McGregor)
73- Fixed the versioning extension so that the history table is updated within
74  the current transaction (patch from and closes ticket #35).
75
760.5.1 - 2008-02-07
77
78New features:
79- Added a new elixir plugin for managing entities as (ordered) lists.
80- Added a `column_format` keyword argument to `ManyToMany` which can be used
81  to specify an alternate format string for column names in the mapping table.
82- Added support for custom base classes which inherit from another class (ie
83  not directly from object).
84- Added an alternate (nicer) syntax to define synonym properties.  This syntax
85  has a more limited scope, except that it can refer to properties defined in
86  a parent entity. This is based on a patch from Alexandre da Silva.
87
88Changes:
89- Added check so that using an inexisting column in an order_by or other
90  column-name based argument raises an exception.
91- The polymorphic_identity kwarg in using_mapper_options is not overriden
92  anymore by the one generated by Elixir (patch from Ben Bangert).
93- Moved the format of the multi-table inheritance column to a constant in
94  options (so that it can be changed globally).
95- The foreign key constraint of the column in a multi-table inheritance is
96  configured with a cascade rule.
97
98Bug fixes:
99- A child entity doesn't inherit anymore its parent entity statements (such as
100  options) if it doesn't use any statement itself.
101- Made inheritance work for custom base classes (closes #25).
102- Fixed the inverse relationship matching when the inverse relationship is
103  defined in a parent Entity (thanks to Alexandre da Silva).
104- Fixed bug in setup_entities (it always used the global entity list and not
105  the list given as argument).
106- Fixed the versioning extension not appropriately handling versioned
107  entities with onupdate events (patch from Remi Jolin, closes #29).
108- Fixed videostore example (patch from Jason R. Coombs, closes #31).
109
1100.5.0 - 2007-12-08
111
112Please see http://elixir.ematia.de/trac/wiki/Migrate04to05 for detailed
113upgrade notes.
114
115New features:
116- Added set method on base Entity (set attributes using kwargs)
117
118Changes:
119- Autosetup defaults to False ! (please look at those upgrade notes!)
120- Polymorphic defaults to True (inheritance is polymorphic by default).
121- Removed one of the autosetup triggers altogether: there is no "fake" mapper
122  registered in SQLAlchemy's mapper_registry anymore, so if you try to
123  access the class mapper directly (not through the 'mapper' attribute on
124  the class), before the setup phase happens, it won't work. This was done
125  because of a change in SQLAlchemy trunk (future SA 0.4.2) which broke that
126  piece of code (and prevented to use autosetup at all). Since that code
127  was a hack in the first place, instead of doing some even uglier hackery,
128  I got rid of it altogether.
129- Moved some format strings to constants in options, so that one can change
130  them if he wants to.
131- Allow overriding primary_key columns on autoloaded entities (closes tickets
132  #20 and #22)
133- Columns created by ManyToOne relationships can now optionally (through
134  column_kwargs) *not* create an index (ie it's not harcoded anymore).
135  Suggestion by Jason R. Coombs.
136
137Bug fixes:
138- Fixed a nasty bug which prevented inheritance to work correctly when using
139  the attribute syntax in many cases.
140- Fixed associable extension to work with SQLAlchemy trunk (future 0.4.2).
141- Fixed an incompatibility with zope.interfaces.
142- Tweaked the initialization sequence again (in fact revert an older change)
143  which prevented to reuse class properties of one class in other (subsequent)
144  classes.
145- Fixed our tests to work with SA trunk (future 0.4.2) (unicode data + use of
146  deprecated attributes)
147
1480.4.0 - 2007-10-29
149
150Please see http://elixir.ematia.de/trac/wiki/Migrate03to04 for detailed
151upgrade notes.
152
153New features:
154- Implemented a new syntax to declare fields and relationships, much closer to
155  what is found in other Python ORM's. The with_fields syntax is now
156  deprecated in favor of a that new syntax. The old statement based (has_field
157  et al.) syntax is still available though (and will remain so for quite some
158  time). This was done with help from a patch by Adam Gomaa.
159- Implemented polymorphic single-table inheritance as well as polymorphic and
160  non-polymorphic multi-table (aka joined table) inheritance.
161- Added ext sub-package for additional Elixir statements.
162- Added associable extension for generating polymorphic associations with
163  Elixir statements.
164- Added versioning extension to keep track to all changes to your entities by
165  storing them in a secondary table.
166- Added encryption extenstion to encrypt/decrypt some fields data on the fly
167  when writing to/reading from the database.
168- Added support for synonym properties.
169- Added shortcut syntax to define column_properties.
170- Added a .query attribute on all entities. The old .query() syntax is still
171  available.
172- Added support to add any SQLAlchemy property on your mapper, through the
173  GenericProperty class (as well as the has_property statement). These can
174  work even if they rely on the entity columns (an thus need them to be
175  defined before the property can be declared). See tests/test_properties.py
176  for examples.
177- Added support for "manual session management" (ie you can now define an
178  entity with "using_options(session=None)" and it won't use any
179  SessionContext extension, nor receive the "query" attribute.
180- Made the statement system more powerfull.
181
182Changes:
183- The setup time was changed. That is the table and mapper are not created as
184  soon as the class is defined, but rather when first used, or when explicitly
185  calling the setup function (recommended). This also allowed us to reorder
186  the setup process and allows, among others to use a ManyToOne-generated
187  column as a primary key, to use unique constraints on those columns, to
188  order by those columns and so on...
189- Made Elixir work with both SQLAlchemy 0.4 and 0.3.10 (with help from a patch
190  by Ants Aasma).
191- Moved away from assign_mapper, now all assign_mapper-provided methods are on
192  the Entity class. Now, if people don't like them, they have the option to
193  simply provide another base class.
194- Default objectstore is now a ScopedSession when working on SQLAlchemy 0.4.
195  It means that it's not wrapped in an Objectstore object at all. This means,
196  that depending on the version of SA you are using, you'll get a slightly
197  different behavior.
198- Relationships to other classes can now also be defined using the classes
199  themselves in addition to the class namees. Obviously, this doesn't work for
200  forward references.
201- Classes defined inside a function can now have relationships to each other.
202- Added default __init__ method on entities so that subclasses can override it
203  and still have the "set attribute by keyword" behavior by calling super()
204- Added "through" and "via" keyword arguments on relationships and has_field
205  statement, to proxy values through relationships (uses association_proxy)
206- Made EntityMeta public, so that people can actually define their own base
207  class.
208- Changed the order of relationship kwargs processing so that computed kwargs
209  can be overridden by kwargs manually passed to the statement. This should
210  only be used if you know what you are doing.
211- Added onupdate kwarg to BelongsTo relationships for consistency with the
212  ondelete kwarg
213- Added ondelete and onupdate kwargs for use with has_and_belongs_to_many
214  to apply on delete clauses to foreign key constraints on the m2m table.
215- Columns of the intermediary table of an has_and_belongs_to_many relationship
216  are now marked as primary keys.
217- Reworked how entities look for primary keys on related entities. This
218  enables one "normal" entity (fully defined in Elixir) to refer to an entity
219  which is autoloaded.
220- Added translation (from column name to column object) of the primary_key
221  mapper option so that it can actually be used. This allows to have entities
222  without any primary key defined at the table level.
223- Added the possibility to give a custom name for ManyToOne constraints
224  (patch from and closes ticket #16)
225- Dropped support for the old threadlocal SA extension (which doesn't even exist
226  anymore in SA 0.4)
227
228Bug fixes:
229- Reworked/cleaned tests so that they don't leak stuff to other tests (both at
230  the method level and module level) anymore. Uses nosetest's module level
231  fixture.
232- Fixed relationships to entities whose primary_key field has been defined
233  with a "key" argument (based on a patch by Paul Johnston).
234- Fixed some buggy tests.
235- Fixed relationships to tables using a schema (patch by Neil Blakey-Milner)
236- Made inverse relationships use backrefs. This fixes the "bidirectional
237  coherency" problem some people had before doing a flush. (based on a patch
238  from Remi Jolin).
239
2400.3.0 - 2007-03-27
241- Made the provided metadata not threadlocal. This could break things for you
242  in some rare case. Please see the (newly created) FAQ file for details about
243  this.
244- Added support for autoloading/reflecting databases with
245  has_and_belongs_to_many relationships. The tablename argument is now
246  optional, but still recommended, otherwise you'll have to use the same exact
247  name for your intermediary table than the one generated. You also _have to_
248  specify at least one of either local_side or remote_side argument.
249- Added support for the "version_id_col" option on entities. This option adds
250  a column to the table which will be used to prevent concurrent modifications
251  on any row of the entity's table (i.e. it will raise an error if it happens).
252- Made the colname argument optional for belongs_to relationships in
253  autoloaded entities. It is only required to specify it if you have several
254  belongs_to relationships between two entities/tables.
255- Applied patch from "Wavy" so that columns of a table are in the same order
256  as they were declared (this only works for the has_field statement).
257- Applied patch from Isaac Csandl to add an "ondelete" argument to
258  belongs_to relationships. The content of that argument is forwarded to the
259  foreign key constraint.
260- Foreign key names generated by belongs_to relationships use column names
261  instead of relation names in case we have a relation with the same name
262  defined in several entities inheriting from the same entity using single-
263  table inheritance (and we set a custom column name in one of them to avoid
264  a column-name conflict).
265- Using invalid options on entities will now raise an exception
266- Added __version__
267- Use an explicit metaclass for entities, so that people can define their own
268  base class.
269- Changed the approach to reflecting/autoloading belongs_to relationships.
270  This shouldn't change anything to how it's used but allowed me to factor
271  some code with has_and_belongs_to_many relationships.
272- The tablename option can now be given a callable so that people can provide
273  their own function to get the table name for an entity. The tablename option
274  can now also be set globally (using the options_defaults dictionary). Of
275  course, this only makes sense for the callable usecase.
276
277- Fixed bug preventing having entities without any statement.
278- Fixed documentation for belongs_to relationships (the arguemnt is "required",
279  not "nullable").
280- Fixed typo which broke the use_alter argument on belongs_to relationships.
281- Fixed inheritance unit test to pass SQLAlchemy type check on relations
282  (introduced in SA 0.3.6)
283- Fixed wrong field length in autoload test (it was not noticeable with sqlite).
284- Actually make the code python 2.3 compatible (Robin's patch was based on
285  0.1.0 while I had introduced more decorators in the trunk in the mean time).
286
287- Made some PEP8 tweaks in many places. Used the pep8 script provided with
288  Cheesecake.
289- Some cleanup/useless code removal
290
2910.2.0 - 2007-02-28
292- Applied patch from Robin Munn to make the code python 2.3 compatible
293- Per a suggestion on the mailing list, look at the calling stack frame to
294  ensure that we apply statements to the proper class.  We now attach the
295  statement list to the class itself, rather than attaching it to a global
296  list that is neither threadsafe, nor safe when doing nested class
297  definition.  Also added a test to validate that this works.
298- implemented singletable non-polymorphic inheritance
299- added support to pass non-keyword arguments to tables. You just pass
300  them to the using_table_options statement and they will be forwarded to the
301  table along with the keyword arguments. This can be used to set table
302  constraints.
303- added support for deferred columns (use the "deferred" keyword argument on
304  fields)
305- added a "required" keyword argument on fields and BelongsTo
306  relationships. This is the opposite of the "nullable" SA argument.
307- added a "column_kwargs" keyword argument to BelongsTo relationships
308  to forward any keyword argument directly to the SA Column.
309- added support for the use_alter and constraint_kwargs kwargs on BelongsTo
310  relationships (forwarded to SA ForeignKeyConstraint).
311    -> removed the systematic use_alter on BelongsTo relations since it
312       can now be specified only when needed.
313    -> removed it from HasAndBelongsToMany relations, since I think a
314       circular foreign key dependency can't happen with those relations.
315- fixed foreign key names on MySQL (and possibly other) databases by
316  making sure the generated name is unique for the whole database, and not
317  only for the table on which it applies.
318- corrected some docstrings
319
3200.1.0 - 2007-02-12
321initial release
Note: See TracBrowser for help on using the browser.