On Tue, 2003-02-18 at 05:15, Bogdan wrote:
> I have Webaware8
> I have error 
> 
> File "/var/Webware/WebKit/averest/index.py", line 35, in writeHTML
>     self.ViewCustomers()
>   File "/var/Webware/WebKit/averest/index.py", line 85, in ViewCustomers
>     stor.readModelFileNamed('/var/Webware/WebKit/averest/Billing')
>   File "./MiddleKit/Core/ModelUser.py", line 41, in readModelFileNamed
>     self._model.read(filename)
>   File "./MiddleKit/Core/Model.py", line 64, in read
>     self.awakeFromRead()
>   File "./MiddleKit/Core/Model.py", line 118, in awakeFromRead
>     self._klasses.awakeFromRead()
>   File "./MiddleKit/Core/Klasses.py", line 101, in awakeFromRead
>     klass.awakeFromRead()
>   File "./MiddleKit/Core/Klass.py", line 71, in awakeFromRead
>     self.pyClass()
>   File "./MiddleKit/Core/Klass.py", line 261, in pyClass
>     self._pyClass =
> self._klassContainer._model.pyClassForName(self.name())  File
> "./MiddleKit/Core/Model.py", line 250, in pyClassForName    exec 'import
> %s%s as module' % (pkg, name) in results  File "<string>", line 1, in ?
> ImportError: No module named Customer
> 
> My code is:
> 
>                con = MySQLObjectStore( user='root',passwd='' )
>               con.readModelFileNamed('/var/Webware/WebKit/averest/Billing')
>               ObjLists = con.fetchObjectsOfClass('Customer')
> 
> This code pefectly working outside webware app!

MiddleKit is not finding your class files.

In the MiddleKit setting file (probably in Billing.mkmodel/Settings.conf
for you), what is the 'Package' setting set to?

The default setting is "Middle", so MiddleKit expects to be able to
import "Middle.Customer".  

It looks like the directory in which you've generated your files is
called Billing, so you'll probably want to change the setting to
"Billing", and then make sure /var/Webware/WebKit/averest is in the
appserver's PYTHONPATH.

If you're doing serious work, though, I would strongly advise against
putting your source files in the Webware source tree.  Instead, use
'MakeAppWorkDir.py', as described in the documentation, to create a
working directory for your code.

hope this helps,

-- 
Jason D. Hildebrand
[EMAIL PROTECTED]



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to