GithubHelp home page GithubHelp logo

plone.sqlalchemy's Introduction

plone.sqlalchemy-14

2021/08/14

  • 更新 sqlalchemy 1.4/2.0

2021/05/01

  • 新增 sqlalchemy_mixins 套件 實現類似 Django ORM 方法

2021/01/01

  • 使用 sqlalchemy , alembic 來實現在 Plone 中使用 ORM 技術

Installation

Library

//需要先手動安裝
sudo apt install alembic
pip3 install SQLAlchemy>=1.4.23
pip3 install sqlalchemy_mixins>=1.5
pip3 install zope.sqlalchemy>=1.5
pip3 install zope.i18nmessageid

//MySql
sudo apt install -y mysql-client
sudo apt-get install libmysqlclient-dev
sudo apt install libssl-dev
sudo apt install libcrypto++-dev
pip3 install mysqlclient

//postgresql
pip3 install psycopg2-binary
sudo apt install libpq-dev python3-dev
pip3 install psycopg2

SetupFile

plone.sqlalchemy/SetupFile 目錄下執行

$ make install
//輸入想要建立的專案位置ex. my.package
//檔案會自動建立在專案內

//如果想參考 Query Method 請參考
alchemy_demo_14.py

Usage

  1. 設定 alembic.ini alembic

  2. 建立 models 參考 user.py and store.py

  3. 編輯 Alembic/env.py

  4. Plone後台 configlet: ORM setting 設定 mysql://{account}:{password}@{localhost}:{port}/{database_name}?charset=utf8mb4

Makefile 同層目錄下使用 make 指令

Makefile

// 如同 git commit -m 'init' 依樣的功能
// 會記錄變更在versions中
$ make migrate m=init

// upgrade to database
$ make upgrade

plone.sqlalchemy's People

Contributors

poliyka avatar

Watchers

 avatar

Forkers

a26703248

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.