Commits

Mike Bayer committed c46ee38

allow the no_criterion call in _get() to copy the method name thorugh

Comments (0)

Files changed (1)

lib/sqlalchemy/orm/query.py

     @util.decorator
     def generate(fn, *args, **kw):
         self = args[0]._clone()
-        fn_name = fn.func_name
+        fn_name = kw.pop('generative_name', fn.func_name)
         for assertion in assertions:
             assertion(self, fn_name)
         fn(self, *args[1:], **kw)
             )
 
     @_generative(__no_criterion_condition)
-    def __no_criterion(self):
+    def __no_criterion(self, generative_name=None):
         """generate a Query with no criterion, warn if criterion was present"""
 
     def __get_options(self, populate_existing=None, version_check=None, only_load_props=None, refresh_state=None):
             ident = util.to_list(ident)
 
         if refresh_state is None:
-            q = self.__no_criterion()
+            q = self.__no_criterion(generative_name="get")
         else:
             q = self._clone()