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

field_file.html doesn't call value method #195

Closed
crimsonhawk47 opened this issue Dec 9, 2024 · 1 comment
Closed

field_file.html doesn't call value method #195

crimsonhawk47 opened this issue Dec 9, 2024 · 1 comment

Comments

@crimsonhawk47
Copy link

Looks like everywhere else calls field.value() except this file, which just uses value like a property. This causes fields like ImageField to render incorrectly. Am I using it wrong or is this an error?

Looks like changing it to field.value().url and field.value().name works.

image

@smithdc1
Copy link
Member

Hi @crimsonhawk47

Looks like changing it to field.value().url and field.value().name works.

Accessing methods with () like in field.value().url doesn't look like valid django template (DTL) code to me. The crispy-form templates are based upon using the DTL. Your example looks to me like it could be Jinja2?

It seems to work for me when using the crispy-test-project, but I could be looking at it wrong.

If you could share a minimal reproduction that would be helpful.

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

No branches or pull requests

2 participants