推荐学习书目
› 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 · 3757 views
    This topic created in 3244 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
        1
    superlead  
       Nov 10, 2017
    用 xadmin 有这个功能~
    exiaohao
        2
    exiaohao  
       Nov 10, 2017
    search_fields 可以定义啊
    matrix1010
        3
    matrix1010  
       Nov 11, 2017 via Android   ❤️ 1
    自定义一下,可以参考我的 https://github.com/Yiling-J/django-admin-select-search
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   894 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:45 · PVG 03:45 · LAX 12:45 · JFK 15:45
    ♥ Do have faith in what you're doing.