Ian Bicking wrote:
> It expects an id or a ComponentCategory object -- since you didn't pass
> an object, it tried to treat it like an integer id.
>
> Anyway, try it again from CVS and see if it works for you now.
Better, but still no joy... with the same data model, I get:
Create category:
>>> from test import *
>>> compCat = ComponentCategory.new(name="Test Cat")
>>> compCat
<ComponentCategory 1 name='Test Cat' description=None sequenceNum=None>
Create component with default category of None:
>>> comp = Component.new(name="Test Comp")
>>> comp
<Component 1 name='Test Comp' categoryId=None sequenceNum=None>
>>> comp.category
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 1, in <lambda>
AttributeError: 'Component' object has no attribute 'ComponentCategory'
Create component with instance of ComponentCategory as argument for
category:
>>> comp = Component.new(name="Test Comp2", category=compCat)
>>> comp
<Component 2 name='Test Comp2' categoryId='1' sequenceNum=None>
>>> comp.category
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 1, in <lambda>
AttributeError: 'Component' object has no attribute 'ComponentCategory'
...Edmund.
|