- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当使用以下代码时:
{% with ""|add:revision.width|add:"x"|revision.height as dimensions %}
{% thumbnail revision.image dimensions as thumb %}
{% endwith %}
我收到以下错误:
Django Version: 1.6.11
Exception Type: TemplateSyntaxError
Exception Value:
Invalid filter: 'revision'
Exception Location: /usr/local/lib/python2.7/site-packages/django/template/base.py in find_filter, line 366
Python Executable: /usr/local/bin/python
Python Version: 2.7.9
为什么?我能做些什么来解决这个问题?
最佳答案
问题出在链中最后应用的过滤器 (revision.height
)。
替换:
{% with ""|add:revision.width|add:"x"|revision.height as dimensions %}
与:
{% with ""|add:revision.width|add:"x"|add:revision.height as dimensions %}
<小时/>
您还可以将变量分配给revision.width
和revision.height
:
{% with width=revision.width height=revision.height %}
{% with ""|add:width|add:"x"|add:height as dimensions %}
...
{% endwith %}
{% endwith %}
关于python - 过滤器无效 : 'revision' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29474954/
举个例子:假设在 svn update 之后我使用的是修订版 10。如果我现在添加一个文件并执行提交,svnversion 将报告我处于混合修订版的状态;即10点11分。但由于这些数字是按顺序排列的,
链接: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-howto-rollback.html 描述了错误提交后回滚 SVN 目录的两种
在 Android 上制作 cat/proc/cpuinfo 返回这种输出: Processor : ARMv7 Processor rev 1 (v7l) processor
我在一个使用 alembic 管理数据库迁移的团队中工作。我最近拉了master,并尝试运行alembic upgrade heads .我收到以下消息; INFO [alembic.runtime
当我执行 git submodule update --init 时出现错误 fatal: Needed a single revision Unable to find current revisi
我有一个项目,我想在其中自动嵌入修订号。 在这种情况下,它是一个多文件 perl 脚本。在主文件中,我有一行如下所示: 我的 $revision = '$Revision: 24 $'; 当我发布时,
当使用以下代码时: {% with ""|add:revision.width|add:"x"|revision.height as dimensions %} {% thumbnail revi
我的幻灯片是这样说的: 递归调用应该总是在比当前调用更小的数据结构上 如果数据结构太小,必须有非递归的选项 您需要一个包装器方法来使递归方法可访问 仅从幻灯片中阅读此内容毫无意义,尤其是考虑到这是圣诞
归并排序的工作方式是: 获取值列表 一分为二 取每个列表的第一个元素,最小值进入一个新列表(我想从原来的列表中删除)。比较接下来的两个数字 - 这样做直到一个列表为空,然后将另一个列表的其余部分放在
我目前正在制作一个脚本,在其中我已经熟悉 Tortoise SVN 及其相应的命令行功能。 我正确更新了脚本,以通过一系列测试找到正确构建的“修订版”。在脚本记录该变量(特定于版本号的)之后,我更新到
我一直在使用 git subtree split 将一个巨大的存储库(从另一个 VCS 导入到 Git)划分为较小的存储库。 $ git subtree split -P ./path/to/fold
我想用c#读/写窗口信息文件(扩展文件属性) 通过执行以下操作找到的:在窗口资源管理器中右键单击 => 属性 => 摘要选项卡。我主要想访问属性: 职位 类别 修订号 对于办公文档,我可以使用以下(使
如何导出/获取属于修订版的所有文件? 例如: 在修订版 5434 上,如果我们提交了 5 个文件,如何获取指定修订版的所有 5 个文件? 类似 svn export有修订号,但我 只有想要我在该修订版
我们曾经有一个用于多个项目的共享SVN存储库,昨天,我们的SVN管理员创建了一个特定于我们项目的新SVN存储库。 我将项目的现有 checkout 位置重新定位到了新的SVN存储库,但是现在,当我进行
我的仓库有 3 次提交。我想挤成一个。 我运行 git rebase -i HEAD~3 并得到这个错误: fatal: Needed a single revision invalid upstre
我们将 svn:externals 用于库的特定修订,例如像 xyzlib -r12345 https://asdf.asdf.local/xyzlib/trunk/ 当您在工作副本中对此类 chec
我希望将韩文地名罗马化。函数 stringi::stri_trans_general 支持韩文罗马化,但显然不符合广泛应用和官方的 Revised Romanization of Korean 方案。
当人们在OCaml中引用“修订的语法”时,他们是说这将成为该语言的新语法,还是只是在CamlP4中创建的替代语法?如果是前者,那么“修订语法”何时会成为OCaml的“官方语法”? 最佳答案 修改后的语
我有一种情况: 开发人员正在从事 SVN 项目。 人检查 SVN 项目,走开, child /猫/妻子坐下/dools/sleepwalks/任何在计算机上并插入 gobbledygook asdfg
这里只是一个小的SVN“问题”。 我设置了自己的 SVN 服务器 Setting up Subversion on Windows 现在我做了一个代表,我所有的项目都将参与其中。 现在,我在名为“Pr
我是一名优秀的程序员,十分优秀!