First try with the django.utils.functional.lazy decorator. My function returns two lists, so I'm decorating it with @lazy(list, list). It's a plain jane function, not a method/property on a class.
I'm getting a "' proxy ' object is not callable" when I try to call the resulting decorated function.
I don't think you can use Django's lazy as decorator. You can use it as a function call:
lazy_function = lazy(f, type)
where f
is the function you need to make lazy and type
is the expected data type.
Also how do you return the two lists? Like:
def a():
return [], []
If yes, then technically you are returning a tuple hence you should use lazy as:
lazy_f = lazy(f, tuple)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.