SQLObject v1.1發佈 Python資料庫物件映射框架

來源:互聯網
上載者:User

SQLObject 1.1.0 發佈,SQLObject 是一個流行的Python 資料庫物件映射框架,映射的規則就是表->類、欄位->屬性。

過提供用於運算元據庫表的類和物件,物件關係映射工具有助於提高生產率。 Python 最好的物件關係映射工具是 SQLObject —— 一個開放源碼專案,它幾乎完成程式設計資料庫所需的所有操作。 本文介紹 SQLObject 及其功能。 閱讀本文後,您將能夠不編寫任何 SQL 代碼而連接 Python 與資料庫。

當面向物件程式設計範例滿足大多數資料庫的關係範例時,通常會看到物件關係映射。 物件關係映射是這兩個世界的橋樑。 它允許您定義與資料庫表對應的類。 然後您可以使用這些類及其實例上的方法來與資料庫交互,而不用編寫 SQL。 使用物件關係映射並不意味著不需要知道HTTP://www.aliyun.com/zixun/aggregation/22.html">關係資料庫如何工作,而是不必要編寫 SQL,從而避免程式設計錯誤。

您可以找到一打以上的操作 SQL 資料庫的開放源碼 Python 包,這還沒包括用於連接 Python 與特定資料庫的特殊用途模組。 SQLObject 是其中最好的模組。 它是簡單易用的完全物件關係映射包。 SQLObject 幾乎可以完成程式設計資料庫所需的所有操作。

SQLObject 1.1版本資訊:

Features & Interface

SelectResults (returned from .select()) is allowed in IN(column, list). A different workaround is used in SQLiteConnection to prevent PySQLite from converting strings to unicode - in the case of a registered text conversion function PySQLite silently converts empty strings to Nones; now SQLObject uses text_factory instead and properly returns empty strings. It is now possible to declare one encoding for all UnicodeCol's per table (as sqlmeta.dbEncoding) or per connection (as co nnection.dbEncoding). Default (if dbEncoding is found neither in column nor in table nor in connection) is 'utf-8'.

Source code and internals

Decorators @classmethod and @staticmethod are used everywhere. All 'mydict.has_key(name)' checks were replaced with 'name in mydict'.

安裝說明:

You can install the latest release with:

easy_install -U SQLObject

You can install the latest version of SQLObject with:

easy_install SQLObject==dev

You can install the latest bug fixing branch with:

easy_install SQLObject==bugfix

If you want to require a specific revision (because, for instance, you need a bugfix that hasn't appeared in a release), y ou can put this in your setuptools using setup.py file:

setup(... install_requires=["SQLObject==bugfix,>=0.7.1dev-r1485"],)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.