choice property in google app engine

后端 未结 2 1740
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 00:40

platform: django 1.0, google app engine, app-engine-patch , python 2.5.4

i am tring to use the choices attribute as i always have been using in django website

<
2条回答
  •  被撕碎了的回忆
    2021-01-17 01:23

    This is a documented problem that will not be resolved. Simply put, you can't do this when using GAE.

    Guido says the following when closing the above ticket:

    I'm very sorry, but I have to close this as invalid.

    The App Engine definition of the choices parameter to the db.Property class is different from the Django definition. See http://code.google.com/appengine/docs/datastore/propertyclass.html#Property

    I realize that this may cause problems when you're trying to create a form from the model, but the solution is to override the form field using a custom widget and passing the list of desired choices to the widget. (There's an example of this in Rietveld, in codereview/views.py, class SettingForm.)

提交回复
热议问题