[Modeling-users] Problem in module location
Status: Abandoned
Brought to you by:
sbigaret
From: <luk...@po...> - 2003-11-22 18:44:36
|
Hi I notice a strange behavior. When I import this script showed below all i= s ok, Python finds the module "Matki" (sorry for strange names - ther are i= n Polish :-). But when I call function "PokazMatki()" I got this error. Interesting thing is that when I replace matki=3DEC.fetch('Matki') with matki=3DEC.fetch('Matki', rawRows=3D1) all is ok again. The package "BazaAdresowa" isn't in directory where is t= his 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=3DEditingContext() matki=3DEC.fetch('Matki') #------ Traceback (most recent call last): File "<stdin>", line 1, in ? File "PS_Baza.py", line 55, in PobierzMatki matki=3DEC.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=3Dself.parentObjectStore().objectsWithFetchSpecification(fs, = ec) File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\ObjectStoreCoordinator.py", li= ne 434, in objectsWithFetchSpecification return store.objectsWithFetchSpecification(aFetchSpecification, anEditingContext) File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\DatabaseContext.py", line 1765= , in objectsWithFetchSpecification object=3Dchannel.fetchObject() File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\DatabaseChannel.py", line 269,= in fetchObject object=3Dcd.createInstanceWithEditingContext(ec) File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", li= ne 177, in createInstanceWithEditingContext theClass=3Dself.classForInstances() File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", li= ne 161, in classForInstances theClass=3DclassForEntity(self._entity) File "C:\PROGRA~1\Zope2.6.2\bin\Modeling\EntityClassDescription.py", li= ne 521, in classForEntity raise ImportError, err_msg ImportError: Unable to locate class BazaAdresowa.Matki.Matki correspondin= g to entity 'Matki'. It is possible that the model's packageName, or the entity's moduleName o= r className do not correspond to where the module is installed --for exampl= e, 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 **************************** * =A3ukasz =A3akomy * luk...@po... **************************** |