Odd behaviour in admin interface

2 views
Skip to first unread message

timh

unread,
May 8, 2008, 8:03:30 PM5/8/08
to Google App Engine
Hi

I am noticing some odd things about Admin interface I have two
classes with almost identical properties
however in the Admin interface some of the fields are listed as type
None, and you can't enter data.
Also if I add data by instantiating the class directly and filling in
the fields (listed in Admin as None) then the admin errors with a
NoneType error.

e.g

class Base(db.Model):
id = db.StringProperty()


class XXX(db.Model):
first_name = db.StringProperty()
last_name = db.StringProperty()
email = db.EmailProperty(db.Email)
role = db.ListProperty(str)

class Person(Base):
""" Person class, used to represent any person we wish to
identify"""

default_view = TLPageTemplateFile("person.pt")

first_name = db.StringProperty()
last_name = db.StringProperty()
email = db.EmailProperty(db.Email)
role = db.ListProperty(str)

In admin GAE supplied interface it shows Person Email as None, and

Entity Kind Person
Entity Key agRiYW9ucgwLEgZQZXJzb24YBww
ID 7
first_name (string)
last_name (string)
email (None)
id (string)

and XXX Class

Edit Entity
Entity Kind XXX
Entity Key agRiYW9ucgkLEgNYWFgYEQw
ID 17
last_name (None)
email (Email)

And in fact XXX class in admin doesn't even show the first name field.

If I view a Person with in the GAE Admin interface that does actually
have an email address I
get


Traceback (most recent call last):
File "/home/timh/Desktop/google_appengine/google/appengine/ext/
webapp/__init__.py", line 484, in __call__
handler.get(*groups)
File "/home/timh/Desktop/google_appengine/google/appengine/ext/admin/
__init__.py", line 439, in get
field = data_type.input_field(name, value, sample_values)
File "/home/timh/Desktop/google_appengine/google/appengine/ext/admin/
__init__.py", line 541, in input_field
if len(sample_value) > 255 or sample_value.find('\n') >= 0:
TypeError: object of type 'NoneType' has no len()



I am a tad confused, about what the Admin interface is actually doing.
As I can add the entities in code, and interact with them normally.
There doesn't seem to be any consistancy to these iregularities from
class to class as far as I can tell.

Any thoughts.

T
Reply all
Reply to author
Forward
0 new messages