l***@poczta.fm
2003-11-22 16:45:03 UTC
Hi
I notice a strange behavior. When I import this script showed below all is
ok, Python finds the module "Matki" (sorry for strange names - ther are in
Polish :-). But when I call function "PokazMatki()" I got this error.
Interesting thing is that when I replace
matki=EC.fetch('Matki')
with
matki=EC.fetch('Matki', rawRows=1)
all is ok again. The package "BazaAdresowa" isn't in directory where is this
script. The package is in Python directory in subdirectory "GifExtensions".
When I copy the package "BazaAdresowa" to the directory where the script is
everything works fine again. Strange isn't it? Could you give me some
explanation?
#------
from mx.DateTime import *
from Modeling.EditingContext import EditingContext
from GifExtensions.BazaAdresowa.Matki import Matki
def PokazMatki():
EC=EditingContext()
matki=EC.fetch('Matki')
#------
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "PS_Baza.py", line 55, in PobierzMatki
matki=EC.fetch('Matki')
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EditingContext.py", line 1419, in
fetch
return self.objectsWithFetchSpecification(fs)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EditingContext.py", line 1302, in
objectsWithFetchSpecification
objects=self.parentObjectStore().objectsWithFetchSpecification(fs, ec)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\ObjectStoreCoordinator.py", line
434, in objectsWithFetchSpecification
return store.objectsWithFetchSpecification(aFetchSpecification,
anEditingContext)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\DatabaseContext.py", line 1765,
in objectsWithFetchSpecification
object=channel.fetchObject()
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\DatabaseChannel.py", line 269, in
fetchObject
object=cd.createInstanceWithEditingContext(ec)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", line
177, in createInstanceWithEditingContext
theClass=self.classForInstances()
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", line
161, in classForInstances
theClass=classForEntity(self._entity)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", line
521, in classForEntity
raise ImportError, err_msg
ImportError: Unable to locate class BazaAdresowa.Matki.Matki corresponding
to entity 'Matki'.
It is possible that the model's packageName, or the entity's moduleName or
className do not correspond to where the module is installed --for example,
you might have moved it to a sub-package. You can solve this easily by
updating your model so that 'packageName.moduleName.className' points to
the exact location where the class is installed
Original exception was: ImportError: No module named BazaAdresowa
****************************
* Łukasz Łakomy
* ***@poczta.fm
****************************
I notice a strange behavior. When I import this script showed below all is
ok, Python finds the module "Matki" (sorry for strange names - ther are in
Polish :-). But when I call function "PokazMatki()" I got this error.
Interesting thing is that when I replace
matki=EC.fetch('Matki')
with
matki=EC.fetch('Matki', rawRows=1)
all is ok again. The package "BazaAdresowa" isn't in directory where is this
script. The package is in Python directory in subdirectory "GifExtensions".
When I copy the package "BazaAdresowa" to the directory where the script is
everything works fine again. Strange isn't it? Could you give me some
explanation?
#------
from mx.DateTime import *
from Modeling.EditingContext import EditingContext
from GifExtensions.BazaAdresowa.Matki import Matki
def PokazMatki():
EC=EditingContext()
matki=EC.fetch('Matki')
#------
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "PS_Baza.py", line 55, in PobierzMatki
matki=EC.fetch('Matki')
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EditingContext.py", line 1419, in
fetch
return self.objectsWithFetchSpecification(fs)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EditingContext.py", line 1302, in
objectsWithFetchSpecification
objects=self.parentObjectStore().objectsWithFetchSpecification(fs, ec)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\ObjectStoreCoordinator.py", line
434, in objectsWithFetchSpecification
return store.objectsWithFetchSpecification(aFetchSpecification,
anEditingContext)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\DatabaseContext.py", line 1765,
in objectsWithFetchSpecification
object=channel.fetchObject()
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\DatabaseChannel.py", line 269, in
fetchObject
object=cd.createInstanceWithEditingContext(ec)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", line
177, in createInstanceWithEditingContext
theClass=self.classForInstances()
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", line
161, in classForInstances
theClass=classForEntity(self._entity)
File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", line
521, in classForEntity
raise ImportError, err_msg
ImportError: Unable to locate class BazaAdresowa.Matki.Matki corresponding
to entity 'Matki'.
It is possible that the model's packageName, or the entity's moduleName or
className do not correspond to where the module is installed --for example,
you might have moved it to a sub-package. You can solve this easily by
updating your model so that 'packageName.moduleName.className' points to
the exact location where the class is installed
Original exception was: ImportError: No module named BazaAdresowa
****************************
* Łukasz Łakomy
* ***@poczta.fm
****************************