dvska / appengine-admin

Automatically exported from code.google.com/p/appengine-admin
0 stars 0 forks source link

ReferenceProperty error when trying to access objects that contain references to deleted objects #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Creating a comment and then deleting all articles causes ReferenceProperty
failed to be resolved when trying to view comments whose article references
were deleted articles.

Error:
{{{
Traceback (most recent call last):
  File "C:\Program
Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py",
line 499, in __call__
    handler.get(*groups)
  File "Z:\appengine_admin_test\appengine_admin\__init__.py", line 143, in get
    self._callHandlingMethod(url, self.getRegexps)
  File "Z:\appengine_admin_test\appengine_admin\__init__.py", line 162, in
_callHandlingMethod
    function(*matched.groups())
  File "Z:\appengine_admin_test\appengine_admin\authorized.py", line 14, in
check_login
    handler_method(self, *args, **kwargs)
  File "Z:\appengine_admin_test\appengine_admin\__init__.py", line 202, in
list_get
    'items': map(modelAdmin._attachListFields,
modelAdmin.model.gql(modelAdmin.listGql))
  File "Z:\appengine_admin_test\appengine_admin\__init__.py", line 80, in
_attachListFields
    property.value = getattr(item, property.name)
  File "C:\Program
Files\Google\google_appengine\google\appengine\ext\db\__init__.py", line
2333, in __get__
    raise Error('ReferenceProperty failed to be resolved')
Error: ReferenceProperty failed to be resolved
}}}

Original issue reported on code.google.com by valdiic on 27 Nov 2008 at 12:49

GoogleCodeExporter commented 9 years ago
I see several ways how to solve the real cause of the problem:
1. Do not delete any records at all. Use some flag for checking if the record is
active or not.
2. Override delete() method for your data model that dereferences records in 
models
that contain reference to record that is being deleted.

However Appengine Admin should not fail with error when referenced entries are
deleted. So, there is a place for a patch.

Original comment by valdiic on 27 Nov 2008 at 12:49

GoogleCodeExporter commented 9 years ago
Fixed in r26

Original comment by valdiic on 27 Nov 2008 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by valdiic on 28 Nov 2008 at 7:56