當前位置: 首頁>>代碼示例>>Python>>正文


Python Room.get方法代碼示例

本文整理匯總了Python中models.Room.get方法的典型用法代碼示例。如果您正苦於以下問題:Python Room.get方法的具體用法?Python Room.get怎麽用?Python Room.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models.Room的用法示例。


在下文中一共展示了Room.get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get

# 需要導入模塊: from models import Room [as 別名]
# 或者: from models.Room import get [as 別名]
 def get(self):
     room_key = self.request.get('room_key')
     room = Room.get(room_key)
     data_list = []
     #data_list = room.getRoomProfile()
     data_list.append({'roomNumber':room.roomNumber,'area':room.area,'rentSingle':room.rentSingle,'rentDouble':room.rentDouble})
     output_json = json.dumps(data_list)
     self.response.out.write(output_json) 
開發者ID:cnherald,項目名稱:rentalHouseManagement2,代碼行數:10,代碼來源:rentalManager.py

示例2: rooms_edit

# 需要導入模塊: from models import Room [as 別名]
# 或者: from models.Room import get [as 別名]
def rooms_edit(request):
    id = int(request.GET.get('id'))
    room = Room.get(db.Key.from_path('Room', id))
    if request.method != 'POST':
            form = RoomForm(instance=room)
            return respond(request, 'room_edit.html', {'form': form, 'id': id })
    
    form = RoomForm(request.POST,instance=room)
    if form.is_valid():
        entity = form.save()
        entity.put()
        return HttpResponseRedirect(reverse(rooms))
    else:
        return respond(request, 'room_edit.html', {'form': form })
開發者ID:krukmat,項目名稱:HOD,代碼行數:16,代碼來源:views.py

示例3: rooms_delete

# 需要導入模塊: from models import Room [as 別名]
# 或者: from models.Room import get [as 別名]
def rooms_delete(request):
    id = int(request.GET.get('id'))
    room = Room.get(db.Key.from_path('Room', id))
    room.active = False
    room.put()
    return HttpResponseRedirect(reverse(rooms))
開發者ID:krukmat,項目名稱:HOD,代碼行數:8,代碼來源:views.py


注:本文中的models.Room.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。