Hi,

I am having two problems with MiddleKit.

1. When i try and run the following code in a Webware servlet, I get an
error saying there is no such module 'model.Client'
----------------------------------------------
clients = store.fetchObjectsOfClass('Client')
----------------------------------------------

however if i add this line before it, it works.
----------------------------------------------
path = os.path.normpath(self.request().serverSideContextPath())
sys.path.insert(0, path)
----------------------------------------------

Do I really need to do this to get it to work.
My directory structure looks like this.
----------------------------------------------
/web/Apps/                  # this is a webware context
          myapp/
                control/    # this is where my servlets
                  model/    # this is where my model is
                        myapp.mkmodel/
----------------------------------------------

2. I notice that middle kit auto creates a Primary Key for every class we
define in the CSV file.
Does this mean we should not be using our own primary keys (eg. composite
keys) ?

If i have a schema like this,

Employee
       name     char(30)
       company  Company

Company
       name   char(30)

should the following code give me the company name ? (after middle kit
generates the above mk objects)
----------------------------------------------
employees = store.fetchObjectsOfClass('Employee')
for emp in employees
   emp.company().name()
----------------------------------------------

Many Thanks

Huy


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to