On Apr 28, 2011, at 4:46 AM, Mark Stanton wrote:

> How do I get the application to include my newly generated form?
> I've saved the class in the ui directory of my generated app.
> I would prefer not to care and, as the Class Designer screencast does 
> it, just run the form.  But it appears things have moved on since 
> that screencast and this doesn't work because it doesn't find the 
> BizObj.
> 
> I've found the Python file ui/__init__.py, which seems to have the 
> list of forms that the application knows about it, but adding my new 
> class to the list of imports, either with or without the cdxml 
> extension just gives me "ImportError: No module named <FormName>".


        You can't import a .cdxml file - it is simply XML text, not a Python 
class. It is converted to a class when you need it.

        You will have to reference the file using standard pathing; e.g., 
"ui/MyForm.cdxml". You pass that path to one of the UI functions that handle 
cdxml files: dabo.ui.createForm(), and dabo.ui.createClass(). The former 
returns an instantiated form object; the latter returns a class object that you 
can instantiate when you want.

        Let me know if that helps, and if you have any other questions.


-- Ed Leafe



_______________________________________________
Post Messages to: Dabo-users@leafe.com
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/33795e54-d172-4ef9-8ea1-c2ffb6373...@leafe.com

Reply via email to