[Fixed]-Django readonly fields in template

1👍

Got it !!

First, i must call this line in the template so it can recognize the widget tweaks:

{% load widget_tweaks %}

Then call the property inside the include like this:

{%include "partials/field.html" with field=form_request_update.request|attr:"readonly:True" %}

Works like a charm.

Leave a comment