推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
eriale
V2EX  ›  Python

各位都是怎么开发需要大量数据操作的应用?

  •  
  •   eriale · May 27, 2014 · 3880 views
    This topic created in 4395 days ago, the information mentioned may be changed or developed.
    背景:基于django做的订单系统。
    这个系统中,有很多数据CRUD操作。比如说订单创建,不同阶段要往订单中录入定金、发货时间、押金等。
    其实每个阶段的录入工作,都是在做数据库update,但是因为每次update的东西不一样,我现在的做法就是再写一个函数,
    另外,目前从前端提交数据转换我用的是django自带的modelform,因为每次修改的field不一样,我只好再代码中一个个从cleaned_data中取出来。
    form输出到前端时,要格式化时间显示,还要模板上用过滤器转格式,这样就要一个个手写{{form.xxxfield}}。
    各位有什么好的办法吗?或者说说你们再项目中怎么对付这种经常做数据修改的情况。
    1 replies    2014-05-28 02:38:28 +08:00
    tonitech
        1
    tonitech  
       May 28, 2014
    因为你不能确定表单中的每个字段的共性,所以一般情况下只能一个个手写的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   974 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:53 · PVG 03:53 · LAX 12:53 · JFK 15:53
    ♥ Do have faith in what you're doing.