跳转到主要内容

使用django-dbpreferences,您可以将应用程序/用户设置存储到数据库中。

项目描述

描述

使用django-dbpreferences,您可以存储一些应用程序/用户首选项到数据库。

Build Status on travis-ci.org

travis-ci.org/jedie/django-dbpreferences

Coverage Status on coveralls.io

coveralls.io/r/jedie/django-dbpreferences

Status on landscape.io

landscape.io/github/jedie/django-dbpreferences/master

A django app defines a form with initial values. The form cleaned data dict would be stored serialized into the database. The app can easy get the current preference dict and the user can easy edit the values in the django admin panel.

With UserSettings you can store some settings per user.

更多信息及示例请见此处

单元测试

存在不同的方式来运行单元测试,例如。

.../django-dbpreferences $ ./setup.py test
.../django-dbpreferences $ ./manage.py test
.../django-dbpreferences $ ./runtests.sh

运行特定的测试,例如。

.../django-dbpreferences $ ./setup.py test tests.test_dbpreferences.TestDBPref
.../django-dbpreferences $ ./manage.py test tests.test_dbpreferences.TestDBPref
.../django-dbpreferences $ ./runtests.sh tests.test_dbpreferences.TestDBPref

Django兼容性

django-tools

Django版本

python

v0.6.0

1.6 - 1.8

2.7, 3,4

v0.5.0

<=1.6

2 only

v0.4.5

<=1.4

2 only

(version combination will be tested via travis-ci)

历史记录

  • v0.6.0 - 11.08.2015 - compare v0.5.0…v0.6.0

    • 错误修复和与Python 2和3、Django 1.6-1.8的兼容性

    • data_eval 使用ast模块重写

    • dbpreferences.fields.DictField 已重命名为 DictModelField

  • v0.5.0 - 12.02.2015 - compare v0.4.5…v0.5.0

    • 支持Django 1.6的变更

  • v0.4.5 - 2012年08月03日 - 比较v0.4.4…v0.4.5

  • v0.4.4 - 2012年08月03日 - 比较v0.4.3…v0.4.4

    • 添加对South的支持(如果已安装)

    • 可以使用 ./setup.py test 运行测试

    • 添加德语翻译

  • v0.4.3

    • 错误修复:针对‘UserSettings’对象没有属性‘get_settings’的问题 [链接]

  • v0.4.2

    • 错误修复:将模板添加到pypi包中

  • v0.4.1

    • 错误修复与BooleanField相关的问题

  • v0.4.0

    • 新增:如果保存的偏好设置中不存在初始数据,则使用初始数据。这使得添加新的偏好值更容易。

  • v0.3.8

    • 错误修复:在错误信息中对于不存在的键的错误处理

  • v0.3.7

    • 更改版本方案,并将最后的git提交日期添加到版本字符串中

  • v0.3.6

    • 在ValidationError上显示当前值

  • v0.3.5

    • 针对Django v1.2 API变更进行更新

  • v0.3.4

    • 错误修复:如果help_text包含非ASCII字符和HTML代码

  • v0.3.3

    • 使用模型验证验证偏好设置

    • 在get_preferences()中清理偏好设置

  • v0.3.2

    • 一些错误修复

  • v0.3.1

    • 错误修复:如果DictField可以为空/DictFormField(required=False)

  • v0.3.0

    • 将models.py中的字段相关内容分离到fields.py中,以便在其他项目中使用。

    • 使用自定义字典类进行序列化/反序列化

    • 更新unittest以适应新的Django admin URL前缀

  • v0.2.0

  • v0.1.0

pip升级

要在虚拟环境中执行pip升级,请运行以下命令

~$ cd /YourVirtualEnv/bin
~/YourVirtualEnv/bin$ source activate
(YourVirtualEnv)~/YourVirtualEnv/bin$ pip install --upgrade --verbose --editable=git+git://github.com/jedie/django-dbpreferences.git#egg=django-dbpreferences

示例使用git只读克隆URL。如果您使用subversion,请这样做

(YourVirtualEnv)~/YourVirtualEnv/bin$ pip install --upgrade --verbose --editable=http://svn.github.com/jedie/django-dbpreferences.git#egg=django-dbpreferences

如果您具有git写权限,请使用此命令

(YourVirtualEnv)~/YourVirtualEnv/bin$ pip install --upgrade --verbose --editable=git+git@github.com:jedie/django-dbpreferences.git#egg=django-dbpreferences

捐赠

如果您喜欢它,请向以下地址发送一些Bitcoins1HLNVtZFwdHLavRKdUebTGHVn8A7e6Dgne ;)

项目详情


下载文件

下载适合您平台的文件。如果您不确定该选择哪个,请了解有关安装包的更多信息。

源分发

django-dbpreferences-0.6.0.tar.gz (25.5 kB 查看哈希值)

上传时间:

构建分发

django_dbpreferences-0.6.0-py2.7.egg (30.4 kB 查看哈希值)

上传时间:

django_dbpreferences-0.6.0-py2-none-any.whl (34.6 kB 查看哈希值)

上传时间: Python 2

支持者