[storm] GROK-STORM TROUBLE
JAVIER VELASQUEZ GOMEZ
heavylu at gmail.com
Thu Jul 17 02:20:40 BST 2008
Hi everybody,
I'm implementing an Information System using grok and storm, I'm just
starting (after "translate" my DB to suitable Zope interfaces), then I tried
to adapt the example in
http://grok.zope.org/documentation/how-to/grok-orm-with-storm to my DB.
Summarizing the example: At the end you get an application which renders,
to the index page, some fields for each record from a table of your DB, you
also get a link to an adding form (create new record in the DB's table).
When you fill out the add-form and order to create the record, the data are
written to the DB and you are redirected to the index page.
It seems everything works well, but when the system is redirecting to the
index page, zope throws the next error:
* ERROR SiteError http://localhost:8080/sinadlab/@@index
. . .
. . .
"$GROKPATH/Sinadlab/src/sinadlab/app.py", line 36, in getBajas
for obj in self.context.items():
. . .
. . .
File
"/usr/local/lib/python2.4/site-packages/storm-0.12-py2.4.egg/storm/variables.py",
line 491, in parse_get
raise ValueError("Invalid enum value: %s" % repr(value))
ValueError: Invalid enum value: u'Pendiente'*
The value 'Pendiente' is an option from a *schema.Choice* field I defined in
the interface for a table from my DB, I did it in the file interfaces.py:
*class IBajas (Interface):*
*. . .*
* Autorizac = Choice(title=u"Aut...",*
* description=u"Indica si...",*
* values=['Pendiente','Si','No'],*
* default='Pendiente',*
* required=True)*
*. . . *
And I Implemented that interface in other file, this way:
*class Bajas (grok.Model, Storm):*
* grok.implements(IBajas)*
* __storm_table__ = "Bajas"*
*. . . *
* Autorizac = Enum (map={'Pendiente':1,'Si':2,'No':3})*
. . .
The add form is generated by a class in app.py file using *grok.AutoFields*,
and It works well. When I click on the "create" button, the data are
written to my DB, but when the index page tries to perform *for obj in
self.context.items():* , it brokes down and doesn't work even if I try to
reload the index page.
My DB server is MySQL 5.0.45-Debian_1ubuntu3.3-log Debian etch
distribution. The table "Bajas" has , in fact, a field called Atorizac
defined this way: *Autorizac enum('Pendiente','Si','No') NOT NULL . *When I
delete all records from "Bajas" TABLE, the application workS again and I
get able to reload the index page, so It seems storm catch an exception when
it tries to read the enum Field from my table. It might be either the datum
is being miswritten or the reading has a problem.
Does anyone know what could be happening to my system? thanks in advance
for your comments and ideas.
JAVIER VELÁSQUEZ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20080716/624a628d/attachment.htm
More information about the storm
mailing list