mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Added raw_queryset keyword to returns_typeclass_list decorated funcs
This commit is contained in:
parent
5a811a2d89
commit
3d7ac9e365
1 changed files with 6 additions and 1 deletions
|
|
@ -23,7 +23,12 @@ def returns_typeclass_list(method):
|
|||
"""
|
||||
def func(self, *args, **kwargs):
|
||||
self.__doc__ = method.__doc__
|
||||
return list(method(self, *args, **kwargs))
|
||||
raw_queryset = kwargs.pop('raw_queryset', False)
|
||||
result = method(self, *args, **kwargs)
|
||||
if raw_queryset:
|
||||
return result
|
||||
else:
|
||||
return list(result)
|
||||
return update_wrapper(func, method)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue