views:

11

answers:

0

How can I use properties in db.models that are not meant to be handled as datastore properties?

For instance:

class SpotModel(db.Model):
  rating = db.RatingProperty(default=3, choices=[1,2,3,4])

  @smiley.setter
  def smiley(self, value):
    return value

In the above I have a property called smiley, but when I test it using nosetests --with-gae I get:

@smiley.setter
NameError: name 'smiley' is not defined

I'm guessing it's because the smiley property is not defined since there is no init where it could be defined.

But how can I solve this? I don't want to store the smiley value in the datastore.