Пример #1
0
 def decorated_function(*args, **kwargs): # pylint: disable=missing-docstring
     g.model_key = ndb.Key(urlsafe=kwargs['key'])
     g.model_db = g.model_key.get()
     if g.model_db:
         return func(*args, **kwargs)
     return make_not_found_exception()
Пример #2
0
 def decorated_function(*args, **kwargs): # pylint: disable=missing-docstring
     g.user_db = model.User.get_by('username', kwargs['username'])
     if g.user_db:
         return func(*args, **kwargs)
     return make_not_found_exception()
Пример #3
0
 def decorated_function(*args, **kwargs):  # pylint: disable=missing-docstring
     g.simulation_db = model.Simulation.get_by('name', kwargs['name'])
     if g.simulation_db:
         return func(*args, **kwargs)
     return make_not_found_exception()