def post(self):
        #TODO consistency on the redirect
        name = self.request.get('name')
        
        if not name:
            return "You need to post the 'name' field"

        new_table = Table(name=name)
        new_table.put()

        self.redirect('/')
Ejemplo n.º 2
0
 def handle(self):
     p = float(self.request.get("p"))
     SEATS_PER_TABLE = 10
     for price in [p]:
         t = Table(price=btc2satoshi(price))
         t.put()
         for n in xrange(SEATS_PER_TABLE):
             seat = Seat(table=t, number=n, purchase_addr=new_address(), state=EMPTY)
             seat.table = t
             seat.put()
             from time import sleep
             sleep(1)
             
     return {"success":True}
Ejemplo n.º 3
0
    def handle(self):
        p = float(self.request.get("p"))
        SEATS_PER_TABLE = 10
        for price in [p]:
            t = Table(price=btc2satoshi(price))
            t.put()
            for n in xrange(SEATS_PER_TABLE):
                seat = Seat(table=t,
                            number=n,
                            purchase_addr=new_address(),
                            state=EMPTY)
                seat.table = t
                seat.put()
                from time import sleep
                sleep(1)

        return {"success": True}