推荐学习书目
› 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
davinci
V2EX  ›  Python

django admin 如何指定要搜索的字段

  •  
  •   davinci · Nov 10, 2017 · 3860 views
    This topic created in 3290 days ago, the information mentioned may be changed or developed.

    有两个框

    第一个框为搜索框为下拉列表。可选选项为表的字段。选择要搜索的字段。比如选择了字段 age

    第二个框为输入框。输入选中字段的值。比如值为 12

    点击搜索后,展示所有 age 等于 12 的记录。

    3 replies  •  2017-11-11 08:29:02 +08:00
    superlead
    superlead
    Nov 10, 2017
    1
    用 xadmin 有这个功能~
    exiaohao
    exiaohao
    Nov 10, 2017
    2
    search_fields 可以定义啊
    matrix1010
    matrix1010
    Nov 11, 2017 via Android❤️1
    3
    自定义一下,可以参考我的 https://github.com/Yiling-J/django-admin-select-search
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1506 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 257ms · UTC 16:49 · PVG 00:49 · LAX 08:49 · JFK 11:49
    ♥ Do have faith in what you're doing.