Changes between Version 3 and Version 4 of Migrate03to04

Show
Ignore:
Timestamp:
12/07/07 10:20:25 (7 years ago)
Author:
ged (IP: 213.219.135.238)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Migrate03to04

    v3 v4  
    2828 
    2929One of the most important (even if not the most visible) change in version 0.4 is that your entities (classes) are not setup as soon as the entity is declared anymore. But what does it mean when an entity is setup, you'll ask? By setup, I mean that the (SQLAlchemy's) table and mapper objects are created. So now when you declare your class, nothing of that happens. From that point, you have two options: 
    30  * you decide yourself when you want Elixir to do that setup phase. It means that, at one point, you tell Elixir to setup the entities you have already declared by using `setup_all()` or `setup_entities([...])` explicitly. You usually do this after you have declared all your entities, so that they can find each other without problem. This is the recommended approach even though it is '''not''' the default. To use this method of setup you have to configure your entities with the `autosetup=False` option. This can be done globally, for all your entities, by adding the following line: {{{elixir.options_defaults['autosetup'] = False}}} once and before you declare any of your entities. 
     30 * you decide yourself when you want Elixir to do that setup phase. It means that, at one point, you tell Elixir to setup the entities you have already declared by using `setup_all()` or `setup_entities([...])` explicitly. You usually do this after you have declared all your entities, so that they can find each other without problem. This is the recommended approach even though it is '''not''' the default in version 0.4 (it is in version 0.5). To use this method of setup in version 0.4 you have to configure your entities with the `autosetup=False` option. This can be done globally, for all your entities, by adding the following line: {{{elixir.options_defaults['autosetup'] = False}}} once and before you declare any of your entities. 
    3131 
    32  * you let Elixir guess when you want that setup phase to happen. For that your entities need to have the `autosetup=True` option. For backward-compatibility reasons, this is the default for now, even though it is not the recommended way. In that case, the setup phase will happen as late as possible: it will only happen if and when '''any''' of your ''autosetup'' entities are used in any of the following ways for the first time:  
     32 * you let Elixir guess when you want that setup phase to happen. For that your entities need to have the `autosetup=True` option. For backward-compatibility reasons, this is the default in version 0.4, even though it is not the recommended way. In that case, the setup phase will happen as late as possible: it will only happen if and when '''any''' of your ''autosetup'' entities are used in any of the following ways for the first time:  
    3333     * it is instantiated,  
    3434     * some of its attributes are accessed (`c`, `query`, `table`, or `mapper`),