仅自动保存更改的模型数据。

otree-save-the-change的Python项目详细描述


https://img.shields.io/pypi/v/django-save-the-change.svghttps://travis-ci.org/karanlyons/django-save-the-change.svg?branch=masterhttps://codecov.io/github/karanlyons/django-save-the-change/coverage.svg?branch=master

保存更改如下:

>>> lancelot=Knight.objects.get(name="Sir Lancelot")>>> lancelot.favorite_color="Blue">>> lancelot.save()

这样做:

UPDATE"roundtable_knight"SET"favorite_color"='Blue'

而不是这个:

UPDATE"roundtable_knight"SET"name"='Sir Lancelot',"from"='Camelot',"quest"='To seek the Holy Grail.',"favorite_color"='Blue',"epithet"='The brave',"actor"='John Cleese',"full_name"='John Marwood Cleese',"height"='6''11"',"birth_date"='1939-10-27',"birth_union"='UK',"birth_country"='England',"birth_county"='Somerset',"birth_town"='Weston-Super-Mare',"facial_hair"='mustache',"graduated"=true,"university"='Cambridge University',"degree"='LL.B.',

安装

安装并保存更改,与其他操作一样:

$ pip install django-save-the-change

文档

完整的文档可在 ReadTheDocs

历史

1.1.0(2014年5月16日)

  • Add proper support for ForeignKeys (thanks to Brandon Konkle and Brian Wilson).
  • Add update_together field to model Meta, via UpdateTogetherModel.

1.0.0(2013年8月9日)

  • Initial release.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java不调用未来。有什么问题吗?   isSelected(),isDisplayed在selenium、java for checkbox中不适用于我。其中xpath不显示是选中还是未选中   java在线应用程序创建者是如何工作的?是否有任何示例源代码可供查看?   Rest服务中的java Spring启动自定义异常   java将成员对象添加到ArrayList<Membership>   关键字这个Java项目如何使用语言保留字作为标识符?   字符串格式如何在Java中打印列中的双精度数组   java libgdx动画仅在事件上出现一次   java如何使用spring。应用docker容器上RestTemplate url中的名称?   java Hibernate UnuniqueObjectException:具有相同标识符值的不同对象已与会话关联   使用leapmotion、光标显示的java处理   java Libgdx Box2D仅针对少数特定对象控制冲突响应   带外键的java Spring数据JPA@Query:参数不匹配   java在我的“ifelse”语句中遇到问题,我不知道如何将文本字段转换为整数(或其他)   java Maven插件没有在我希望的地方运行