Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Viewing all articles
Browse latest Browse all 9596

BoPress 1.1 发布,Python 通用后台

$
0
0

BoPress 1.1 发布,主要改进内容包括:

SQLAlchemySession完全在插件中创建,方便连接池及相关DB参数等配置

增强插件结构,每个插件都是一个独立的App,有自己的静态文件及模板文件

增加控制数据表行访问的对象权限,并增加权限对象联动删除监听及 权限对象联动 批量删除辅助删除函数

运行环境适配到2.7+

各种重构及优化

权限对象使用示例:

from bopress.user import ObjectPermissionChecker
s = SessionFactory.session()
chk = ObjectPermissionChecker(user_id=2)
objects_subq = chk.get_objects(["edit_post", "r_edit_post"], Posts)
posts = s.query(Posts.title, Posts.content) \
.select_from(objects_subq).outerjoin(Posts, Posts.post_id == objects_subq.c.object_id) \
.all()
print(posts)

一个具备独立结构的相册插件示例:查看


BoPress 1.1 发布,Python 通用后台

Viewing all articles
Browse latest Browse all 9596

Trending Articles