Changes between Initial Version and Version 1 of Ticket #35544


Ignore:
Timestamp:
Jun 20, 2024, 10:44:33 AM (5 months ago)
Author:
Sven R. Kunze
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35544 – Description

    initial v1  
    2222        context = super().get_context(name, value, attrs)
    2323        context["widget"]["type"] = self.input_type
    24         context["is_readonly"] = self.is_readonly
     24        context["is_readonly"] = self.is_readonly  # new for usage in template as well
    2525        return context
     26
     27    def render(self, name, value, attrs=None, renderer=None):
     28        """Render the widget as an HTML string."""
     29        context = self.get_context(name, value, attrs)
     30        if self.is_readonly:
     31            return self._render(self.readonly_template_name, context, renderer)
     32        return self._render(self.template_name, context, renderer)
    2633
    2734
Back to Top