cubicweb #961831 migration failure when defining form fields [resolved]
In the cube conference, I use the cube shoppingcart, but define a custom field to override the behavior of the default form for ShoppingItem. This custom field references ShoppingItem in an attribute of the class. When Python reads the class definition, it looks for ShoppingItem in the schema, but since the migration and its add_cube('shoppingcart') has not been run yet, it can not find it. This means that one can not access the shell nor migrate the instance. Embracing the form field definition in a try/except fixes the problem, but is kind of ugly. Could not we find a better way to prevent this to happen ?
|closed by||#faee4c380e50 [forms] catching KeyError closes #961831: migration failure when defining form fields|
- cubicweb #1337615 warn the user when remove_cube is asked whereas an instance is already running
- cubicweb #1381203 [formfields] not all fields delegate form analysis to their widget
- cubicweb #1624937 [form handling] easy access to form values
- cubicweb #171331 ReST / html validation
- cubicweb #969169 [inline forms] do not show the 'remove' link if cardinality is '1x'