Exemplo n.º 1
0
  def _getGiftTransactions(self, sender_id, receiver_id):
    results = []
    if sender_id:
      results = GiftTransaction.gql('WHERE sender_id=:sender_id', 
                                sender_id=sender_id)
    elif receiver_id:
      results = GiftTransaction.gql('WHERE receiver_id=:receiver_id',
                                receiver_id=receiver_id)
    else:
      results = GiftTransaction.all()

    return results;
Exemplo n.º 2
0
    def _getGiftTransactions(self, sender_id, receiver_id):
        results = []
        if sender_id:
            results = GiftTransaction.gql('WHERE sender_id=:sender_id',
                                          sender_id=sender_id)
        elif receiver_id:
            results = GiftTransaction.gql('WHERE receiver_id=:receiver_id',
                                          receiver_id=receiver_id)
        else:
            results = GiftTransaction.all()

        return results
Exemplo n.º 3
0
    def post(self):
        """Store a new gift transaction in the datastore based on the POST data."""
        if not self._isValidSignature():
            return

        giftTransaction = GiftTransaction()
        giftTransaction.sender_id = self.request.get('sender_id')
        giftTransaction.receiver_id = self.request.get('receiver_id')
        giftTransaction.gift = Gift.get(self.request.get('gift_key')).key()
        giftTransaction.put()
Exemplo n.º 4
0
  def post(self):
    """Store a new gift transaction in the datastore based on the POST data."""
    if not self._isValidSignature():
      return

    giftTransaction = GiftTransaction()
    giftTransaction.sender_id = self.request.get('sender_id')
    giftTransaction.receiver_id = self.request.get('receiver_id')
    giftTransaction.gift = Gift.get(self.request.get('gift_key')).key()
    giftTransaction.put()
Exemplo n.º 5
0
 def getGiftTransactions(self):
   giftTransactions = []
   for t in GiftTransaction.all():
     giftTransactions.append("sender: %s, reciever: %s, gift: %s" %
     (t.sender_id, t.receiver_id, t.gift.key()))
   return giftTransactions
Exemplo n.º 6
0
 def initGiftTransactions(self):
   """Deletes any existing gift transactions."""
   for t in GiftTransaction.all():
     t.delete()
Exemplo n.º 7
0
 def getGiftTransactions(self):
     giftTransactions = []
     for t in GiftTransaction.all():
         giftTransactions.append("sender: %s, reciever: %s, gift: %s" %
                                 (t.sender_id, t.receiver_id, t.gift.key()))
     return giftTransactions
Exemplo n.º 8
0
 def initGiftTransactions(self):
     """Deletes any existing gift transactions."""
     for t in GiftTransaction.all():
         t.delete()