Hi,

I was doing some tests using the CVS head, with the MiddleKit
PostgreSQL Adapter.
I created the class definition file (in csv format), and generated the
SQL and .py without problems.
I created the database with the generated SQL and it worked fine.
Then I created a simple script to test the classes:

import os, sys
sys.path.insert(1, os.path.abspath(os.pardir))
sys.path.insert(1, "/usr/local/Webware/")

from mx.DateTime import DateFrom
from MiddleKit.Run.PostgreSQLObjectStore import PostgreSQLObjectStore
from WebKit.Teste.Middle.Unidade import Unidade

def main():
    # Set up the store
    store = PostgreSQLObjectStore (user='diogo')
    store.readModelFileNamed('../Middle/Movel')
    
    unidade = Unidade()
    unidade.setNomeUnidade("Teste")
    store.addObject(unidade)
    store.saveChanges()

if __name__=='__main__':
    main()

When I execute this script I've got the following stack trace:
Traceback (most recent call last):
  File "./main.py", line 22, in ?
    main()
  File "./main.py", line 18, in main
    store.addObject(unidade)
  File "MiddleKit/Run/ObjectStore.py", line 134, in addObject
  File "MiddleKit/Run/MiddleObject.py", line 296, in
addReferencedObjectsToStore  File "MiddleKit/Run/MiddleObject.py",
line 291, in klass
AttributeError: Unidade instance has no attribute '_mk_klass'

It seems that the model it's not being loaded, but the file is there
and the script is opening it. Any idea on what could be the problem?
I'm using eric3 to debug it, but I couldn't figure out what is wrong.

Here is the content of my Classes.csv:

"Class","Attribute","Type","Default","isRequired","Min","Max","Notes"
"Vendedor",,,,,,,
,"nomeVendedor","string",,1,1,100,
,"unidade","Unidade",,1,,,
"Unidade",,,,,,,
,"nomeUnidade","string",,1,,50,
,"cidade","string",,,,50,
,"uf","string",,,,2,

Thanks in advance,
-- 
Diogo Biazus
[EMAIL PROTECTED]
http://www.postgresql.org.br


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to