Hi,
I've got a simple problem and I'm sure there is a simple solution but
I haven't found it yet.
I try to do the following :
from google.appengine.ext import db
class Player(db.Model):
currentgame=db.ReferenceProperty(Game)
class Game(db.Model):
player1=db.ReferenceProperty(Player,collection_name="player1_set")
player2=db.ReferenceProperty(Player,collection_name="player2_set")
So of course, "Game" isn't available when first going through the
Player definition.
I tried doing "Player.currentgame=db.ReferenceProperty(Game)" after
the Game definition, which may or may not be the right way, but then I
get this error when setting the currentgame property :
ERROR 2008-04-08 22:19:18,330 __init__.py] Traceback (most recent
call last):
File "/usr/local/google_appengine/google/appengine/ext/webapp/
__init__.py", line 486, in __call__
handler.post(*groups)
File "/Users/sylvainzimmer/w/svnjamendo/trunk/googlemusicgame/
ajax.py", line 29, in post
resp = self.method(method)
File "/Users/sylvainzimmer/w/svnjamendo/trunk/googlemusicgame/
ajax.py", line 92, in method
found.currentgame=game.key()
File "/usr/local/google_appengine/google/appengine/ext/db/
__init__.py", line 2234, in __set__
setattr(model_instance, self.__id_attr_name(), value)
File "/usr/local/google_appengine/google/appengine/ext/db/
__init__.py", line 2280, in __id_attr_name
return self._attr_name()
File "/usr/local/google_appengine/google/appengine/ext/db/
__init__.py", line 468, in _attr_name
return '_' +
self.name
TypeError: cannot concatenate 'str' and 'NoneType' objects
So that's it, thanks for any help!