예제 #1
0
 def post(self):
     user = get_valid_user()
     car = MileageVehicle()
     car.make = self.request.get('make')
     car.model = self.request.get('model')
     car.year = int(self.request.get('year'))
     car.description = self.request.get('description')
     car.public = (self.request.get('public') == 'on')
     car.users = [user.key()]
     car.put()
     self.redirect('car/%d/' % car.key().id())
예제 #2
0
 def get(self):
     user = mileage.user.get_current_user()
     if user is None:
         self.redirect('adduser')
     else:
         self.redirect('user/%s/' % user.key().id())