django queryset for script
Project description
Easy QuerySet
只是为了方便地使用 Django Models 来写脚本
安装
pip install easy_queryset
示例
from easy_queryset import models, add_mysql
# 数据库配置
add_mysql('localhost', 'username', 'password', 'example_db')
add_mysql('localhost', 'username', 'password', 'example_db', app_label="example")
class Users(models.Model):
id = models.CharField()
name = models.CharField()
email = models.CharField()
class Meta:
app_label = "default" # 指定数据库配置
db_table = "users"
class Group(models.Model):
id = models.CharField()
name = models.CharField()
email = models.CharField()
class Meta:
app_label = "example" # 指定数据库配置
db_table = "group"
Users.objects.all()
Group.objects.all()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
easy_queryset-0.0.3.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for easy_queryset-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ad2ca65cbe453547f943fc634cd28a1492899b0480bbffabb9c3dc8e3179d86 |
|
MD5 | 5b7024eaa0c09b3a2520d868630c8ed2 |
|
BLAKE2b-256 | 4b709ff08ba32f1d322de85ec721d6d9d59e5e3780d82ce299b721b6b2159e81 |