Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key error when accessing the rest uri for the second time #12

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 6 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. register models with rest.Dispatcher.add_models({'testuri': model})
2. 1st request: access /rest/testuri -> gives the desired response
3. 2nd request: access /rest/testuri -> gives a key error "name testuri 
already used"

What is the expected output? What do you see instead?
You should get the response for the 1st response, right?

What version of the product are you using? On what operating system?
gae sdk 1.3.0 & win xp

Please provide any additional information below.
adding rest.Dispatcher.model_handlers = {} before 
rest.Dispatcher.add_models() fixes the issue but this is not desired. Why 
are the model_handlers from the previous request still accessible in the 
2nd request? 

Original issue reported on code.google.com by m.e.siersema on 4 Feb 2010 at 9:46

@GoogleCodeExporter
Copy link
Author

google appengine caches the application for a period of time between requests to
speed up access, documented here:

http://code.google.com/appengine/docs/python/runtime.html#App_Caching

are you registering your models in a main() method?  if so, you can fix your 
problem
by moving the model registration out of the main() method so that it is only 
executed
once when the module is loaded.

Original comment by jahlborn@gmail.com on 4 Feb 2010 at 6:49

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Hi thanks for your response. The models we're registered outside the main() 
function 
and still gave the error. I think it's indeed the app caching. Setting 
rest.Dispatcher.model_handlers = {} works for me fine. Thanks for the great lib 
btw.

Original comment by m.e.siersema on 8 Feb 2010 at 3:25

@GoogleCodeExporter
Copy link
Author

Original comment by jahlborn@gmail.com on 9 Feb 2010 at 2:08

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Issue 14 has been merged into this issue.

Original comment by jahlborn@gmail.com on 14 Apr 2010 at 1:27

@GoogleCodeExporter
Copy link
Author

I found that when I get data using JSON_TYPE request,the data type always 
change to String.
Is it support keep the data type information to client?

Original comment by xiaorux...@gmail.com on 22 Feb 2011 at 8:51

@GoogleCodeExporter
Copy link
Author

please don't add questions to unrelated bug reports.  please file a new bug 
report, and try to include as much detail as possible.

Original comment by jahlborn@gmail.com on 22 Feb 2011 at 2:50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant