Adding a user supplied property (at runtime) to an instance of Expando class in Google App Engine?

前端 未结 2 2042
孤城傲影
孤城傲影 2021-01-28 10:37

By creating datastore models that inherit from the Expando class I can make my model-entities/instances have dynamic properties. That is great! But what I want is the names of t

2条回答
  •  情深已故
    2021-01-28 11:11

    Usually, we use the setattr function directly.

    setattr( entity_two, 'some_variable', some_value )
    

提交回复
热议问题