[storm] Defining relationships between classes
Gerdus van Zyl
gerdusvanzyl at gmail.com
Sat Aug 9 12:38:48 BST 2008
I don't think its written down anywhere, I learned about it from the
mailinglist and the mailinglist archives and reading the storm source.
It's the one of the few weaknesses that storm has, lack of
comprehensive documentation.
~Gerdus
On Sat, Aug 9, 2008 at 5:36 AM, Alexei Vinidiktov
<alexei.vinidiktov at gmail.com> wrote:
> On Fri, Aug 8, 2008 at 11:00 PM, Gerdus van Zyl <gerdusvanzyl at gmail.com> wrote:
>> The NameError: name 'Card' is not defined exception means Card is not
>> in the current namespace.
>>
>> In examplemodel.py modify
>> import examplemodel
>> to
>> from examplemodel import Card
>>
>> or
>> card = Reference(card_id, Card.id)
>> to
>> card = Reference(card_id, examplemodel.Card.id)
>>
>> You also have a circular reference Card to Example and Example to Card
>> , in my experience you will have to lazy define one half of that like:
>> invoice = Reference(invoiceno, 'invoice.invoiceno')
>> instead of
>> invoice = Reference(invoiceno, invoice.invoiceno)
>
> Thanks, Gerdus!
>
> Applying both fixes solved my problem.
>
> I'm still not totally clear about relations and relationsets, so more
> questions may follow. Like this one: :)
>
> Where can I read about lazy definitions?
>
> --
> Alexei Vinidiktov
>
More information about the storm
mailing list