Changes between Version 5 and Version 6 of BehindTheScene

Show
Ignore:
Timestamp:
12/07/07 20:32:24 (5 years ago)
Author:
ged (IP: 213.219.135.238)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BehindTheScene

    v5 v6  
    2323 
    2424Then, the metaclass (EntityMeta) kicks in. Among others, it: 
    25  * give the opportunity to ClassMutators to act. Which means that each of the class mutators for our class will be processed in turn. Being processed meaning, in the general sense^3^, that the handler function registered for them is called with the arguments stored. In our example, that will result in the following call: `using_options_handler(tablename="movies")`. 
     25 * give the opportunity to ClassMutators to act. Which means that each of the class mutators for our class will be processed in turn. Being processed means, in the simple case, that the handler function registered for them is called with the arguments stored^3^. In our example, that will result in the following call: `using_options_handler(tablename="movies")`. 
    2626 
    27  * process each of the class attributes, looking for instances of the Property class, and `attach` those to the entity. This simply calls the `attach` method on those properties, and give them the ability to know which entity they belong to and the name of the attribute they "manage". Since the Field class is a specialized form of (it inherits from) the Property class, our fields above are included in that processing. Attaching a `Property` to its entity also has the effect of registering it in the list of `EntityBuilder` objects for that entity. More on what those are later. 
     27 * process each of the class attributes, looking for instances of the Property class, and `attach` those to the entity. This simply calls the `attach` method on those properties, and give them the ability to know which entity they belong to and the name of the attribute they "manage". Since the Field class is a specialized form of (it inherits from) the Property class, our fields above are included in that processing. Attaching a `Property` to its entity also has two more effects: it delete the attribute from the class (as to not interfere with SQLAlchemy's attribute management system) and register it in the list of `EntityBuilder` objects for that entity. More on what those are later. 
    2828 
    2929 * if the entity is configured with the option `autosetup=True`, the setup triggers are installed.