Aestate framework for Python,You can see:https://gitee.com/cacode_cctvadmin/aestate
Project description
Aestate —— 多样化数据库查询
介绍
当前仅MySql8.0以上测试通过
Aestate Framework
是一款基于Python
语言开发的ORM
框架,你可以使用多种方式去实现基于对象方式的查询.
比如使用类似django
的模式去使用:modelClass.orm.filter(*args, **kwargs)
或者sqlalchemy的方式:find().where(**kwargs).group_by(*args)
或者像java
的hibernate
一样:
@SelectAbst()
def find_all_F_where_id_in_and_name_like_order_by_id(self, **kwargs) -> list: ...
@Select("SELECT * FROM demo WHERE id=#{id} AND name=#{name}")
def find_all_where_id(self, id, name): ...
或者像java
的mybatis
使用xml
<?xml version="1.0"?>
<aestate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="aestate https://gitee.com/cacode_cctvadmin/aestate-xml/blob/main/v1/tags.xsd"
xmlns="aestate">
<template id="templateField">
id,name,password,create_time,update_time
<description>测试模板</description>
</template>
<item id="findAllById" name="findAllByIdName">
<select resultType="">
SELECT
<!-- 导入查询的字段-->
<include from="templateField"/>
FROM demo_table
<!-- 导入if语句和传入模板所需要的参数-->
<include from="tempWhereIdAndName"/>
AND
<if>
#{p1} = 0
</if>
<elif>
#{p1} = 1
</elif>
<else>
</else>
LEFT JOIN
<!--这个#{this}表示当前表-->
ON #{alias_demo}.id = #{this}.id
</select>
<description>
描述
</description>
</item>
</aestate>
寻找志同道合的朋友一起开发aestate
作者QQ:2075383131(云)
qq群:909044439(Aestate Framework)
先决条件
python >=3.6 (其他版本没试过)
教程文档地址:http://doc.cacode.ren
更全面的教程和文档
安装
pip 命令:pip install aestate
anaconda 安装:conda install aestate
qq群:909044439
依赖包
pip install aestate-json
谁在使用 Aestate Framework 开发网站
CACode: https://cacode.ren
CocoZao 爬虫:https://ccz.cacode.ren
开源示例项目:gitee/aestate-example
CACode Development Team
Last edit time:2021/05/26 02:03 Asia/Shanghai
👉 Go to canotf`s homepage on Gitee 👈
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.