[storm] subclassing and foreign keys with respect to properties from parent
Olaf Conradi
olaf at conradi.org
Mon Aug 18 07:02:12 BST 2008
2008/8/18 James Henstridge <james at jamesh.id.au>:
> On Mon, Aug 18, 2008 at 3:03 AM, Olaf Conradi <olaf at conradi.org> wrote:
>> When I remove the explicit flushes in __init__ of both Person and
>> Agent, the type_id is not written in the subjects table.
>> Is there a way to set type_id of subject without flushing?
>
> Without the flushes, the primary keys on the instances will be None
> (i.e. not allocated yet), so the "self.subject.type_id = self.id"
> calls are not creating links. If you assign to the reference with
> "self.subject.type = self", then Storm should take care of the linkage
> without flushing.
The classes Person and Agent contain a reference like this:
class Person(Storm):
subject = Reference(subject_id, 'Subject.id')
But class Subject does not contain such a member.
How do I then define that because the _info variable is a reference to
either Agents or Persons.
Regards,
-Olaf
More information about the storm
mailing list