You're attempting to set a string to a ReferenceProperty because self.request.get return type of string. The 'ref_category
' field of Product
is a db.ReferenceProperty
, which takes a db.Key
or a Category
object, but you're attempting to set it to a string.
You can do like this :
def post(self):
product = Product()
product.ref_category = db.get(self.request.get('ref_category'))
product.put()