Yes you can find all of them.
You know the ID of the deleted object (112052).
The Key of this object is

rogueKey = db.Key.from_path('Quiz',112052)

or is there a parent object of a Quiz object? If so put that in the path too.

Find all the faulty references

result = Selector.all().filter('quiz =', rogueKey).fetch(1000)

Or use a method like the Mapper class in the remote_api article if
there are a lot of those objects.


2009/8/28 Kambiz Kambiz <[email protected]>:
>
> I can't write a query to find all the objects with this reference
> property since I deleted one object which caused this problem.
> That object is now gone.
>
> That being said, I don't know if your method will work since all my
> object right now are technically OK but since 1 is missing in the
> list, it isn't generating it. Does that make sense?
>
> Kambiz
>
>
> On Aug 27, 4:47 pm, djidjadji <[email protected]> wrote:
>> With a query find all the objects that have this faulty reference property.
>> Create a new property of the correct type and update the objects of the query
>>
>> You can get rid of the list comprehention, make it a for loop that
>> fills a list, catch the exception and filter out the objects with the
>> rogue reference
>>
>> selectors = []
>> for selector in self.get_selectors(user):
>>     try:
>>         if selector.quiz.question_count > 0:
>>             selectors.append(selector)
>>     except Error
>>         pass # or update the reference and put() the selector back
>>
>> 2009/8/27 Kambiz Kambiz <[email protected]>:
>>
>>
>>
>> > I recently ignorantly deleted an entity of mine thru the Dashboard.
>>
>> > Now when only my user accesses a certain section of the app, I recieve
>> > this error:
>>
>> > Traceback (most recent call last):
>> >  File "/base/python_lib/versions/1/google/appengine/ext/webapp/
>> > __init__.py", line 507, in __call__
>> >    handler.get(*groups)
>> >  File "/base/data/home/apps/appname/1.333395169432469460/
>> > quizlink.py", line 757, in get
>> >    selectors = [selector for selector in self.get_selectors(user) if
>> > selector.quiz.question_count > 0]
>> >  File "/base/python_lib/versions/1/google/appengine/ext/db/
>> > __init__.py", line 2704, in __get__
>> >    raise Error('ReferenceProperty failed to be resolved')
>> > Error: ReferenceProperty failed to be resolved
>>
>> > Only my username creates this problem, not other's. I'd like to fix
>> > this, but I can't think of anyway around it. I tried to manually
>> > recreate the entity thru the Dashboard, with the same ID (112052) but
>> > that doesnt work as the ID is randomly generated and cannot be edited.
>> > Anyone have any ideas?
>>
>> > Thanks,
>>
>> > Kambiz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to