I'm trying to work with a set of django models in an external script. I'm querying the database at a preset interval to get the items that meet the query. When my external script is processing them, it takes a while and I may get the same results in the query if the processing hasn't updated the model yet. I figured I could use a set or list to store the items processing and check each model from the query result to ensure it isn't currently processing. When trying this though, it seems the in keyword always returns True. Any thoughts?
(Python 2.6 on ubuntu 10.10)
>>> t
<SomeDjangoModel: Title1>
>>> v
<SomeDjangoModel: Title2>
>>> x
<SomeDjangoModel: Title3>
>>> items
set([<SomeDjangoModel: Title3>, <SomeDjangoModel: Title1>])
>>> t in items
True
>>> x in items
True
>>> v in items
True
>>> items
set([<SomeDjangoModel: Title3>, <SomeDjangoModel: Title1>])
>>>