SQLAlchemy ORM Tools.
Project description
Smart7_ORM
test code
model.py
from smart7_orm import models
class UserMixin(models.Model):
__abstract__ = True
name = models.StringField(50)
fullname = models.StringField(50)
nickname = models.StringField(50)
def __repr__(self):
return "<User(name='%s', fullname='%s', nickname='%s')>" % (
self.name, self.fullname, self.nickname)
class User(UserMixin):
__tablename__ = 'users'
test.py
from model import User
from smart7_orm import setup
user = User.objects.first()
print(user, type(user))
PS
model文件全部引用后需要引入
from smart7_orm import setup
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
smart7_orm-0.0.2.tar.gz
(11.0 kB
view hashes)