Re: faulty installation

1 view
Skip to first unread message
Message has been deleted

Valts Mazurs

unread,
Nov 27, 2008, 1:05:42 AM11/27/08
to appengine-...@googlegroups.com
Hello,

As from your email to django-users list:
===
Thank you, We got it started and well working after temporary
installation problem. Is this a scaffolding function? Is there
(planned) support to edit ReferenceProperty or editable BlobProperty?
===

Do I understand correctly that the error was of temporary nature and is not reproducible or is not caused of Appengine Admin?

--
Valts


On Thu, Nov 27, 2008 at 04:38, niklasr <nikl...@gmail.com> wrote:

Hello,
I'm looking forward running the /admin as some problem appeared:

 NEW Admin object created
 Url:
 regex: <_sre.SRE_Pattern object
 "GET /admin HTTP/1.1" 302 -
 "GET /403.html HTTP/1.1" 404

Thanks in advance for more info about this.
Niklas


Niklas Rosencrantz

unread,
Nov 27, 2008, 1:46:21 AM11/27/08
to appengine-...@googlegroups.com
Yes the inital problem,was solved and Appengine Admin didn't cause the
error. Now one class is editable via Appengine Admin but the second
class generates slight error message

\appengine_admin\__init__.py", line 64, in
_extractProperties
property = getattr(self.model, propertyName)
AttributeError: type object 'Image' has no attribute 't'
INFO 2008-11-27 06:32:08,640 dev_appserver.py] "GET /admin HTTP/1.1" 500 -

The error reproduces when adding a new class:

class DDD(db.Model):
name = db.StringProperty()

class AdminDDD(appengine_admin.ModelAdmin):
model = DDD
listFields = ('name')
editFields = ()
readonlyFields = ()

However leaving out any fields in the Admin entity doesn't reproduce error:

class DDD(db.Model):
name = db.StringProperty()

class AdminDDD(appengine_admin.ModelAdmin):
model = DDD
listFields = ()
editFields = ()
readonlyFields = ()

<type 'exceptions.AttributeError'>: type object 'DDD' has no attribute 'n'
args = ("type object 'DDD' has no attribute 'n'",)
message = "type object 'DDD' has no attribute 'n'"

2008/11/27 Valts Mazurs <val...@gmail.com>:

Valts Mazurs

unread,
Nov 27, 2008, 4:12:44 AM11/27/08
to appengine-...@googlegroups.com
Hello,

The reason for the error is simple.
In line:

listFields = ('name')

This sets listFields to string but Appengine Admin expects it to be a tuple, list or any other iterable object.
To define listFields as tuple add comma before the closing parenthesis:
listFields = ('name',)

This Python syntax "feature" has tricked me several times :)

Regards,
--
Valts

Niklas Rosencrantz

unread,
Nov 27, 2008, 5:39:38 AM11/27/08
to appengine-...@googlegroups.com
List instead of string successfully managed all but three cases:
creating a new comment from the sample classes , edit blobproperty and
referenceproperty.
'reference' fails appengine_admin\__init__.py", line 76, in _attachListFields

property.value = getattr(item, property.name)
File "C:\Program\Google\google_appengine\google\appengine\ext\db\__init__.py",
line 2421, in __get__
raise Error('ReferenceProperty failed to be resolved')
Error: ReferenceProperty failed to be resolved

I run the Article and Comment classes and "create new comment" results in
http://localhost:8080/admin/Comment/new/
appengine_admin\__init__.py", line 139, in get
self._callHandlingMethod(url, self.getRegexps)
\appengine_admin\__init__.py", line 158, in _callHandlingMethod
function(*matched.groups())
\appengine_admin\authorized.py", line 14, in check_login
handler_method(self, *args, **kwargs)
\appengine_admin\__init__.py", line 219, in new_get
self.response.out.write(template.render(path, templateValues))
... raise BadValueError('Property %s is required' % self.name)
BadValueError: Property content is required

Thanks
Niklas

Valts Mazurs

unread,
Nov 27, 2008, 6:18:19 AM11/27/08
to appengine-...@googlegroups.com
Error fixed in revision 20
Please update your working copy and verify if the fix helps.

--
Valts

Niklas Rosencrantz

unread,
Nov 27, 2008, 6:45:52 AM11/27/08
to appengine-...@googlegroups.com
Updated to r20 and create comment works! But 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.

Regards,
Niklas

2008/11/27 Valts Mazurs <val...@gmail.com>:

Valts Mazurs

unread,
Nov 27, 2008, 7:47:11 AM11/27/08
to appengine-...@googlegroups.com
To save data integrity you should not delete records in table that might be referenced by some other table. This is design pattern that is used in quite many real life systems.

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.

--
Valts

Valts Mazurs

unread,
Nov 27, 2008, 5:12:01 PM11/27/08
to appengine-...@googlegroups.com
Hello,

Bug #3 (ReferenceProperty error when trying to access objects that contain references to deleted objects) fixed in r26.
I'd appreciate if you could verify the fix if possible.

Thanks in advance,
--
Valts

Niklas Rosencrantz

unread,
Nov 27, 2008, 11:33:46 PM11/27/08
to appengine-...@googlegroups.com
I'm glad to verify that the fix is working.

Thank you
Reply all
Reply to author
Forward
0 new messages