[storm] subclassing and foreign keys with respect to properties from parent

James Henstridge james at jamesh.id.au
Mon Aug 18 02:41:24 BST 2008


On Mon, Aug 18, 2008 at 3:03 AM, Olaf Conradi <olaf at conradi.org> wrote:
> Hi Jamu,
>
> I've been experimenting with your approach. There is just one thing I
> can't get to work without explicitly flushing the store.
>
>
[snip]
>
> The following code is in the controller:
>
>        p = Subject(Person, name=u'hi there')
>        p.info.gender = self.form_result['gender']
>
>
> 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.

James.



More information about the storm mailing list