Dear Dabo

Platform: GTK
Python Version: 2.5.2 on linux2
Dabo Version: Version 0.8.4; Revision 4740
UI Version: 2.8.9.1 on wxGTK (gtk2)

   I am using SQLite database and created a simple customer database.  
There is only one Table called Customer that has three fields: ID type 
Integer, valid Type bool and name type varchar(30). I am using this 
table for a simple test for the Spread Sheet button test.

   I created a folder called myCalc and used dabo.quickStart() in myCalc 
folder to create all the subfolders biz, db, and so on.  I placed the my 
databse myCalcDB.sqlite in the db folder. I ran Cxn Editor the create 
myCalcConnection with a connection name myCalcCont.cnxml.

First Problem: ---------------------------------------------

   In the ui folder I created my myCalc.cdxml using the class designer 
and create a panel with two vertical sizers.  The top sizer I selected 
"Add controls from data environment" and found the FIRST PROBLEM.  When 
it asked for where my myCalcCon.cnxml was located I was able to able to 
go into my db folder to selected.  When I selected and press next I got 
an error that it could not connect.  After looking at the 
myCalcCon.cnxml database defined it showed:

   <database>myCalcDB.sqlite</database>

I replaced it with the following in my myCalcCon.cnxml and it now works.

   <database>../db/myCalcDB.sqlite</database>

   The next thing I did was selected all the fields in the customer 
table then order them by id, valid and name then select Grid for Layout 
section.  The last thing was when it ask if I wanted to create the 
business object I answered yes. The Grid showed up on the top panel.

Second Problem:   -----------------------------------

   When I try to run the form I get the error:

Attribute Error: 'NoneType' object has no attribute 'CustomerBizobj'

In the Form Editor Object: DesForm Method: *createBixobjs contains:
def createBizobjs(self):
    customerBizobj = self.Application.biz.CustomerBizobj(self.Connection)
    self.addBizobj(customerBizobj)

I checked my biz folder that has the CustomerBizobj.py module that contains:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import dabo

class CustomerBizobj(dabo.biz.dBizobj):
    def afterInit(self):
        self.DataSource = "customer"
        self.KeyField = "id"
        self.addFrom("customer")
        self.addField("valid")
        self.addField("id")
        self.addField("name")

    def validateRecord(self):
        """Returning anything other than an empty string from
        this method will prevent the data from being saved.
        """
        ret = ""
        # Add your business rules here.
        return ret

and the __init__.py has:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
######
# In order for Dabo to 'see' classes in your biz directory, add an
# import statement here for each class. E.g., if you have a file named
# 'MyClasses.py' in this directory, and it defines two classes named 
'FirstClass'
# and 'SecondClass', add these lines:
#
# from MyClass import FirstClass
# from MyClass import SecondClass
#
# Now you can refer to these classes as: self.Application.biz.FirstClass and
# self.Application.biz.SecondClass
######


from CustomerBizobj import CustomerBizobj

   Any idea on what to do?  It seems to me that error message:

Attribute Error: 'NoneType' object has no attribute 'CustomerBizobj'

is saying it can't locate the CustomerBizobj.py in the biz folder.

Bob



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to