Oleg Broytmann a =E9crit :
> On Tue, Oct 31, 2006 at 11:48:26AM +0100, sophana wrote:
> =20
>> The question is in the subject. Sorry if it is a newbie question...
>> When destroying objects, I forgot to clear all pointers to it.
>> How can I select them?
>> =20
>
> to_delete =3D []
> for row in connection.queryAll("SELECT id FROM my_table"):
> id =3D row[0]
> try:
> MyTable.get(id)
> except:
> to_delete.append(id)
>
> Oleg.
> =20
Thanks,
Is there no way of selecting that without doing a python iteration?
In my case, it is object A which has a foreignKey to object B
And I delete some B instances.
|