django:如何获取子字符串?
我正在修改satchmo(一个python在线商店项目),但我发现我无法使用[0, 5]来获取模型中的子字符串。我发现django字符串处理中的类型是类'django.utils.safestring.SafeUnicode'。
'django.utils.safestring.SafeUnicode' 类是否支持 [0, 5] 来获取子字符串,就像在 python 中一样?
I was modifying satchmo(a python online store project), but I found that I can't use [0, 5] to get the substring in the model. And I found the type is class 'django.utils.safestring.SafeUnicode' in django string processing.
Does class 'django.utils.safestring.SafeUnicode' support [0, 5] to get the substring as in python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
切片它。
http://docs.python.org/tutorial/introduction.html
更新:当然,为什么不呢?
Slice it.
http://docs.python.org/tutorial/introduction.html
Update: sure, why not?