本文整理匯總了Python中models.Room.area方法的典型用法代碼示例。如果您正苦於以下問題:Python Room.area方法的具體用法?Python Room.area怎麽用?Python Room.area使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Room
的用法示例。
在下文中一共展示了Room.area方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: post
# 需要導入模塊: from models import Room [as 別名]
# 或者: from models.Room import area [as 別名]
def post(self):
self.response.headers['Content-Type'] = 'application/json'
jsonString = self.request.body
data = simplejson.loads(jsonString) #Decoding JSON
room = Room(key_name = data['roomNumber'] )
room.roomNumber = data['roomNumber']
room.area = float(data['roomArea'])
room.rentSingle = float(data['rentSingle'])
room.rentDouble = float(data['rentDouble'])
room.put()
roomRegisterResponse = {'roomRegisterMsg':'Congratulations, you have registered a new room successfully!'}
json = simplejson.dumps(roomRegisterResponse)
return self.response.out.write(json)