Unable to fetch

James Laska <[email protected]> Sun, 22 May 2005 10:20:44 -0400
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
Greetings,

I am new to the Modeling framework and have been reading the
UsersGuide and working through examples in the document and in tests/.
 I am at the stage where I have defined a sample model (xml).  I can
use that model to generate the python classes and the DB schema.

$ find testmdl/ -type f -name "*py"
testmdl/setup.py
testmdl/MDL/__init__.py
testmdl/MDL/Project.py
testmdl/MDL/model_testmdl.py
testmdl/__init__.py
testmdl/Project.py

I am also able to insert new values into my tables:

>>> from Modeling.EditingContext import EditingContext
>>> from testmdl.Project import Project
>>> ec =3D EditingContext()
>>> p =3D Project()
>>> p.setTitle("Testing 1 2 3")
>>> ec.insert(p)
>>> ec.saveChanges()

However, when it comes to ec.fetch() or ec.fetchCount() I continue to
get a traceback (regardless of whether or not I provide a qualifier):

>>> ec.fetchCount('Project')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/Modeling/EditingContext.py",
line 1259, in fetchCount
    fs=3DFetchSpecification(entityName, qualifier=3Dqualifier, deepFlag=3Di=
sDeep)
  File "/usr/lib/python2.4/site-packages/Modeling/FetchSpecification.py",
line 52, in __init__
    raise ValueError, 'Unable to find a ClassDescription for
entityName: %s. Is the corresponding model loaded?'%entityName
ValueError: Unable to find a ClassDescription for entityName: Project.
Is the corresponding model loaded?

I can see that my previous insert(s) were properly INSERTed in to the table=
:

> select proj_id, proj_title from project;

 proj_id |  proj_title
---------+---------------
       1 | First
       2 | Testing 1 2 3

Any thoughts on what I might be missing?  I searched the list archives
(and google) for the same ValueError but have turned up empty.  I have
also been poking through FetchSpecification+classDescriptionForName
but have turned up nothing so far.  I have installed out of a cvs
checkout as of last week (2005-05-17).

Any help or guidance would be appreciated.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click