def confirm(self): other = UserAccount.query(UserAccount.key==self.connection).get() itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() item = Item.query(Item.key==itemcopy.item).get() due_date = None cur_user = UserAccount.query(UserAccount.key==self.useraccount).get() cur_user.lend_item(int(itemcopy.key.id()), int(other.key.id()), due_date) self.cleanup() otherAction = WaitingToBorrow.query(WaitingToBorrow.item == itemcopy.key and WaitingToBorrow.useraccount == other.key).get() otherAction.cleanup() return "You have agreed to lend %s to %s" %(item.title,other.name)
def confirm(self): itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() other = UserAccount.query(UserAccount.key==itemcopy.borrower).get() item = Item.query(Item.key==itemcopy.item).get() itemcopy.return_item() itemcopy.put() self.cleanup() return "%s has been returned to your library" %(item.title)
def reject(self): other = UserAccount.query(UserAccount.key==self.connection).get() itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() item = Item.query(Item.key==itemcopy.item).get() self.cleanup() otherAction = RequestToBorrow.query(RequestToBorrow.item == itemcopy.key and RequestToBorrow.useraccount == other.key).get() otherAction.cleanup() return "Request cancelled"
def reject(self): other = UserAccount.query(UserAccount.key==self.connection).get() itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() item = Item.query(Item.key==itemcopy.item).get() self.cleanup() otherAction = WaitingToBorrow.query(WaitingToBorrow.item == itemcopy.key and WaitingToBorrow.useraccount == other.key).get() otherAction.cleanup() return "You have denied %s permission to borrow %s" %(other.name,item.title)
def text(self): other = UserAccount.query(UserAccount.key==self.connection).get() itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() item = Item.query(Item.key==itemcopy.item).get() return "%s has requested to borrow '%s'" %(other.name,item.title)
def reject(self): other = UserAccount.query(UserAccount.key==self.connection).get() self.cleanup() return "You have rejected a connection request from %s" %(other.name)
def confirm(self): invitee = UserAccount.query(UserAccount.key==self.connection).get() invited = UserAccount.query(UserAccount.key==self.useraccount).get() invited.add_connection(invitee) self.cleanup() return "You have accepted a connection request from %s" %(invitee.name)
def text(self): other = UserAccount.query(UserAccount.key==self.connection).get() return "%s has requested to connect" %(other.name)
def text(self): itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() other = UserAccount.query(UserAccount.key==itemcopy.borrower).get() item = Item.query(Item.key==itemcopy.item).get() return "%s wants to extend the due date of '%s' to %s?" %(other.name,item.title,str(self.due_date))
def reject(self): itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() other = UserAccount.query(UserAccount.key==itemcopy.borrower).get() item = Item.query(Item.key==itemcopy.item).get() self.cleanup() return "Recorded that %s didn't return %s" %(other.name,item.title)
def text(self): itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() other = UserAccount.query(UserAccount.key==itemcopy.borrower).get() item = Item.query(Item.key==itemcopy.item).get() return "%s reported checking in '%s'" %(other.name,item.title)
def confirm(self): other = UserAccount.query(UserAccount.key==self.connection).get() itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() item = Item.query(Item.key==itemcopy.item).get() print "You have accepted a connection request from %s" %(other.name)
def text(self): other = UserAccount.query(UserAccount.key==self.connection).get() itemcopy = ItemCopy.query(ItemCopy.key==self.item).get() item = Item.query(Item.key==itemcopy.item).get() return "You have requested to borrow '%s' from %s" %(item.title,other.name)