Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 过滤器调用变量时的用法 #256

Closed
4 tasks done
gitiray opened this issue May 6, 2022 · 1 comment
Closed
4 tasks done

[Feature] 过滤器调用变量时的用法 #256

gitiray opened this issue May 6, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@gitiray
Copy link

gitiray commented May 6, 2022

Verify steps

  • Tracker 我已经在 Issue Tracker 中找过我要提出的问题
  • Need 当前 QianDao 框架并不包含该功能特性或者还不完善
  • Framework 这是 QianDao 框架应包含的特性,并非模板特性
  • Meaningful 我提交的不是无意义的 催促更新或修复 请求

Describe the Feature

  1. 发现添加变量到请求链接时,会自动调整为 {{key|urlencode}},对变量使用 urlencode 过滤器进行转换
  2. 在遇到需要转换为 md5 的时候,看到过滤器文档告知可以用 {{md5("text")}},但不支持嵌套变量,结合前面观察到的特性,改成 {{key|md5}},在模板编辑界面测试能达到预期效果,说明这样的写法其实是能够转换的
  3. 在保存模板时报错500,容器日志 TemplateAssertionError: No filter named 'md5'保存时却重新限制了这一用法

Describe the solution

目前我先用 #128 (comment) 提到的方法去写,但相对而言有点复杂,所以:

既然模板测试时能够正常运行、得出结果,语法格式本身和 urlencode 统一、方便、简洁,那就可以放开使用,不必在保存时做出限制

Describe alternatives

其它过滤器都可以放开这种写法

Additional context

No response

@gitiray gitiray added the enhancement New feature or request label May 6, 2022
@a76yyyy a76yyyy closed this as completed in 41b4fae May 6, 2022
@a76yyyy
Copy link
Contributor

a76yyyy commented May 6, 2022

如果更新源码后还不可以请重新打开此issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants