比如在权限检查的时候,当然是可以写decorator,不过 decorator很不直观,我到现在经常看decorator代码还是很晕,我就想能不能写个权限检查的函数,但函数返回值如果在view里如果要判断处理又很麻烦,所以我想能不能在检查函数里抛某个异常,异常里带 response,如果是这个异常uliweb捕获到就直接给客户端返回这个response就好了--我觉得这样挺方便的,limodou你看呢?
-- ----
Project : https://github.com/limodou/uliweb
doc : http://limodou.github.com/uliweb-doc
---
You received this message because you are subscribed to the Google Groups "Uliweb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uliweb+un...@googlegroups.com.
To post to this group, send email to uli...@googlegroups.com.
Visit this group at http://groups.google.com/group/uliweb.
To view this discussion on the web visit https://groups.google.com/d/msgid/uliweb/CAG2rzA%3D9zKNURzUKnx9GAxf4VmdVi%3DOk9DtuuKjGyDMY9HWV7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/uliweb/CADCtg98qSvKqBzcApwrO_4YSk%2BScXE0fL8_vfx8Rn4p%2Bm9gPcg%40mail.gmail.com.