Home
Sign Up
Sign In
推荐学习书目
›
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
V2EX
›
Python
Python 的 django 中出现的|slice:'10',什么意思啊??
happykjoy
·
Jul 14, 2019
· 2723 views
This topic created in 2519 days ago, the information mentioned may be changed or developed.
django 的
view.py
文件中
fruit2 = GoodsInfo.objects.filter(gtype__id=2).order_by("-gclick")[:3]
网页文件中
<a href="/{{
g.id
}}">{{g.gtitle|slice:'10'}}...</a>
这个{{g.gtitle|slice:'10'}}什么意思??怎么网上没看到|slice:'10'这样用法??
slice
itle
django
order_by
2 replies
•
2019-07-14 17:54:32 +08:00
1
SingeeKing
PRO
Jul 14, 2019
1
https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#slice
2
happykjoy
OP
Jul 14, 2019
Thanks! @
SingeeKing
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
846 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms ·
UTC 20:58
·
PVG 04:58
·
LAX 13:58
·
JFK 16:58
♥ Do have faith in what you're doing.
❯