[storm] Error when performing a find

James Henstridge james at jamesh.id.au
Thu Jul 24 13:50:44 BST 2008


On Thu, Jul 24, 2008 at 7:18 PM, Gabriel Rossetti
<gabriel.rossetti at arimaz.com> wrote:
> Hello everyone,
>
> I am playing around with twisted, using the tutorial's Employee, Company
> & such as a base. I tried doing a find like this :
>
> emp = store.find(Employee, Employee.company.name == u"circus")
>
> but I get this exception
>
> AttributeError: 'Reference' object has no attribute 'name'
>
> Can I not do this or am I doing it wrong?
>
> If I do : bob.company.name it returns u"circus", as it should.

You need to structure your query like:

  store.find(Employee, Employee.company == Company.id, Company.name ==
u"circus")

James.



More information about the storm mailing list