🌐 AI搜索 & 代理 主页
Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit e6cbfbd

Browse files
committed
Applied patch from issue 73 to fix the view decorator. Thanks to Thomas Jenkins.
--HG-- extra : convert_revision : svn%3A7a298fb0-333a-0410-83e7-658617cd9cf3/trunk%40150
1 parent 99cc54b commit e6cbfbd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

couchdb/schema.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,13 @@ def __init__(self, design, map_fun, reduce_fun=None, name=None,
260260
@classmethod
261261
def define(cls, design, name=None, language='python', wrapper=DEFAULT,
262262
**defaults):
263-
"""Factory method for use as a decorator."""
264-
def wrapper(fun):
263+
"""Factory method for use as a decorator (only suitable for Python
264+
view code).
265+
"""
266+
def view_wrapped(fun):
265267
return cls(design, fun, language=language, wrapper=wrapper,
266268
**defaults)
267-
return wrapper
269+
return view_wrapped
268270

269271
def __get__(self, instance, cls=None):
270272
if self.wrapper is DEFAULT:

0 commit comments

Comments
 (0)