Discussion:
[Modeling-users] BR: fetch() doesn't bark on wrong class name
Marcos Dione
2004-03-10 21:29:21 UTC
Permalink
User-Agent: Mutt/1.3.28i


is simple to reproduce: just call EditingContext.fetch () with a
wrong class name. I got two different errors with two different
qualifiers, so I thought it was a bad qualifier, and then I realize my
typo. here are those errors:

Traceback (most recent call last):
File "/home/mdione/src/papo_project/cimarron/src/Gtk2/Gtk2Button.py", line 93, in __activate
self.submit()
File "./Generic/Control.py", line 145, in submit
Generic.Exceptions.ControlError: No pude guardar el valor en el Modelo:
... Traceback (most recent call last):
... File "./Generic/Control.py", line 143, in submit
... File "./Generic/Control.py", line 71, in doAction
... File "/home/mdione/src/papo_project/luca/Forms.py", line 58, in save
... guys= ec.fetch ('Person', qualifier='name like "%s"' % self.nameInput.getValue ())
... File "/usr/lib/python2.3/site-packages/Modeling/EditingContext.py", line 1415, in fetch
... fs=FetchSpecification(entityName, qualifier=qualifier, deepFlag=isDeep)
... File "/usr/lib/python2.3/site-packages/Modeling/FetchSpecification.py", line 53, in __init__
... self.setQualifier(qualifier)
... File "/usr/lib/python2.3/site-packages/Modeling/FetchSpecification.py", line 108, in setQualifier
... aQualifier.validateKeysWithRootClassDescription(classDescriptionForName(self._entityName))
... File "/usr/lib/python2.3/site-packages/Modeling/Qualifier.py", line 177, in validateKeysWithRootClassDescription
... allCDkeys=aClassDescription.allAttributesKeys()+\
... AttributeError: 'NoneType' object has no attribute 'allAttributesKeys'

and:

Traceback (most recent call last):
File "/home/mdione/src/papo_project/cimarron/src/Gtk2/Gtk2Button.py", line 93, in __activate
self.submit()
File "./Generic/Control.py", line 145, in submit
Generic.Exceptions.ControlError: No pude guardar el valor en el Modelo:
... Traceback (most recent call last):
... File "./Generic/Control.py", line 143, in submit
... File "./Generic/Control.py", line 71, in doAction
... File "/home/mdione/src/papo_project/luca/Forms.py", line 57, in save
... guys= ec.fetch ('Person', qualifier='name like "%s" AND isActive=1' % self.nameInput.getValue ())
... File "/usr/lib/python2.3/site-packages/Modeling/EditingContext.py", line 1415, in fetch
... fs=FetchSpecification(entityName, qualifier=qualifier, deepFlag=isDeep)
... File "/usr/lib/python2.3/site-packages/Modeling/FetchSpecification.py", line 53, in __init__
... self.setQualifier(qualifier)
... File "/usr/lib/python2.3/site-packages/Modeling/FetchSpecification.py", line 108, in setQualifier
... aQualifier.validateKeysWithRootClassDescription(classDescriptionForName(self._entityName))
... File "/usr/lib/python2.3/site-packages/Modeling/Qualifier.py", line 176, in validateKeysWithRootClassDescription
... keys=self.allQualifierKeys()
... File "/usr/lib/python2.3/site-packages/Modeling/Qualifier.py", line 159, in allQualifierKeys
... self.addQualifierKeysToSet(qualifierKeysList)
... File "/usr/lib/python2.3/site-packages/Modeling/Qualifier.py", line 322, in addQualifierKeysToSet
... qualifier.addQualifierKeysToSet(qualifierKeys)
... AttributeError: 'str' object has no attribute 'addQualifierKeysToSet'
Sebastien Bigaret
2004-03-14 11:43:01 UTC
Permalink
Post by Marcos Dione
is simple to reproduce: just call EditingContext.fetch () with a
wrong class name. I got two different errors with two different
qualifiers, so I thought it was a bad qualifier, and then I realize my
[...]

Ooops. Added ticket #916019, it will be fixed, thanks for the report!

-- Sébastien.
Sebastien Bigaret
2004-09-21 16:18:00 UTC
Permalink
Better late than never... The bug is at last fixed, see
https://sourceforge.net/tracker/index.php?func=detail&aid=916019&group_id=58935&atid=489335

-- Sébastien.
Post by Marcos Dione
is simple to reproduce: just call EditingContext.fetch () with a
wrong class name. I got two different errors with two different
qualifiers, so I thought it was a bad qualifier, and then I realize my
File "/home/mdione/src/papo_project/cimarron/src/Gtk2/Gtk2Button.py", line 93, in __activate
self.submit()
File "./Generic/Control.py", line 145, in submit
... File "./Generic/Control.py", line 143, in submit
... File "./Generic/Control.py", line 71, in doAction
... File "/home/mdione/src/papo_project/luca/Forms.py", line 58, in save
... guys= ec.fetch ('Person', qualifier='name like "%s"' % self.nameInput.getValue ())
... File "/usr/lib/python2.3/site-packages/Modeling/EditingContext.py", line 1415, in fetch
... fs=FetchSpecification(entityName, qualifier=qualifier, deepFlag=isDeep)
... File "/usr/lib/python2.3/site-packages/Modeling/FetchSpecification.py", line 53, in __init__
... self.setQualifier(qualifier)
... File "/usr/lib/python2.3/site-packages/Modeling/FetchSpecification.py", line 108, in setQualifier
... aQualifier.validateKeysWithRootClassDescription(classDescriptionForName(self._entityName))
... File "/usr/lib/python2.3/site-packages/Modeling/Qualifier.py", line 177, in validateKeysWithRootClassDescription
... allCDkeys=aClassDescription.allAttributesKeys()+\
... AttributeError: 'NoneType' object has no attribute 'allAttributesKeys'
[...]
Marcos Dione
2004-09-21 21:45:03 UTC
Permalink
User-Agent: Mutt/1.3.28i
Post by Sebastien Bigaret
Better late than never... The bug is at last fixed, see
https://sourceforge.net/tracker/index.php?func=detail&aid=916019&group_id=58935&atid=489335
wonderful! unluckly I couldn't help you fix this one. I think I owe
you a bottle of wine or similar. good work!
Sebastien Bigaret
2004-09-22 11:18:10 UTC
Permalink
Post by Marcos Dione
User-Agent: Mutt/1.3.28i
Post by Sebastien Bigaret
Better late than never... The bug is at last fixed, see
https://sourceforge.net/tracker/index.php?func=detail&aid=916019&group_id=58935&atid=489335
wonderful! unluckly I couldn't help you fix this one. I think I owe
you a bottle of wine or similar. good work!
Wow, thanks, but wait! :) I only made part of the work. Incidentally, I've just noticed
that the second part of your original message did not exhibit the same bug: it
is in fact due to qualifierWithQualifierFormat() not detecting some syntax
error, such as in:

name like "bob" AND isActive=1

(it is incorrect: '=' is not an operator, but '==' is)

I've just opened a new ticket for this one:
https://sourceforge.net/tracker/index.php?func=detail&aid=1032577&group_id=58935&atid=489335

Attached to this ticket is a patch solving it --it would be nice if enough
people could test it w/ their own qualifiers and report that it does not break
any valid ones, so I can integrate it into the main trunk.

-- Sébastien.

Loading...