Skip to content
Browse files

* Fixed bug in model.find(); used old model_table instead of config('…

…db_models')

* Made session error message only print if config('log') is on
* Remove TODO items
  • Loading branch information...
1 parent 7728147 commit 350306d39714d36e0d4f857ae8e46b188862c243 @breily committed Mar 25, 2009
Showing with 3 additions and 5 deletions.
  1. +0 −2 TODO
  2. +3 −3 juno.py
View
2 TODO
@@ -4,15 +4,13 @@ Important:
[ ] Add authorization.
[ ] Write an intro tutorial (in progress)
-[ ] Add sessions to documentation
Secondary:
[ ] Add other URL wildcards ('#' for numbers, '@' for letters)
[ ] Allow unnamed URL params
[ ] Allow URL parameters with the same name
-[ ] Make sure internal code uses updated functions (i.e. config())
[ ] Decide if '/foo/*:bar/' should match '/foo/'
[ ] Add functionality to dev server to automatically reload changed files (as
in Werkzeug's run_with_reloader)
View
6 juno.py
@@ -315,7 +315,7 @@ def combine_request_dicts(self):
def __getattr__(self, attr):
# Try returning values from self.raw
if attr in self.keys(): return self.raw[attr]
- if attr == 'session':
+ if attr == 'session' and config('log'):
print >>sys.stderr, "Error: To use sessions, enable 'use_sessions'"
print >>sys.stderr, " when calling juno.init()"
print >>sys.stderr, ""
@@ -663,8 +663,8 @@ def find_func(cls):
return tmp
def find(model_cls):
- if type(model_cls) == str:
- try: model_cls = models[model_cls]
+ if isinstance(mode_cls, str):
+ try: model_cls = config('db_models')[model_cls]
except: raise NameError("No such model exists ('%s')" %model_cls)
return session().query(model_cls)

0 comments on commit 350306d

Please sign in to comment.
Something went wrong with that request. Please try again.