Changes between Version 5 and Version 6 of BehindTheScene
- Timestamp:
- 12/07/07 20:32:24 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BehindTheScene
v5 v6 23 23 24 24 Then, 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 mean ing, 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")`. 26 26 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 t he effect of registeringit 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. 28 28 29 29 * if the entity is configured with the option `autosetup=True`, the setup triggers are installed.
