django-widget-tweaks
                                
                                 django-widget-tweaks copied to clipboard
                                
                                    django-widget-tweaks copied to clipboard
                            
                            
                            
                        Optionally add attributes
Some attributes trigger behaviors and meanings simply by their presence, such as the readonly attribute. In these cases even an empty string passed to render_field will cause the field to have the readonly attribute and be read-only, so there is no way to do this and pass 'false' in any form.
In the way that render_field supports both = and += to set or append an attribute, a syntax to optionally add would be great. OR, explicit support for fields like readonly that would just ignore the attribute if the value given was false.
I like the idea. Something like {% render_field form.text readonly?=value %}?
Pull requests are welcome.
The pull request from @Kos looks pretty good! Any chance this will be merged soon?