Exemple #1
0
    def get(self):
        # rides = RideModel.all().filter("when >=",date.today()).run()
        rides = RideModel.all().run()
        rides_json = [ride.to_json() for ride in rides]

        self.response.headers['Content-Type'] = 'application/json'
        self.response.out.write(json.dumps(rides_json))
Exemple #2
0
 def get(self, ride_id):
     ride = RideModel.all().filter("__key__ =", Key(ride_id)).get()
     self.response.write(ride.to_json())
Exemple #3
0
    def get(self, ride_id):
        path = os.path.join(os.path.dirname(__file__), 'ride.html')

        ride = RideModel.all().filter("__key__ =", Key(ride_id)).get()

        self.response.out.write(template.render(path, {'ride': ride}))