Opened 5 years ago

Closed 4 years ago

#15620 closed Cleanup/optimization (duplicate)

ClerableFileInput should render initial value in a flexible way

Reported by: void Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords:
Cc: sun.void@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently rendering of ClerableFileInput's initial value is hardcoded a bit.
It would be nice to extract generation of initial value to the method. This would allow derived classes to override only this method and not the whole render(), as shown in attached patch.

Attachments (1)

clerablefileinput_initial.patch (3.3 KB) - added by void 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by void

comment:1 Changed 5 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Why not, but it'd be preferable to have a general solution for all widgets, which incidentally has been discussed in the django-dev list recently:

comment:2 Changed 5 years ago by julien

  • Resolution set to duplicate
  • Status changed from new to closed

Closing in favour of #15667 which is taking a holistic approach to customizing widget rendering.

comment:3 Changed 4 years ago by void

  • Cc sun.void@… added
  • Easy pickings unset
  • Resolution duplicate deleted
  • Severity set to Normal
  • Status changed from closed to reopened
  • Type set to Cleanup/optimization
  • UI/UX unset

#15667 is still open now, in 16 months after closing this ticket. So I want to reopen my tiny ticket to solve my tiny problem while the big change in widget rendering is still work-in-progress and there are chances that it will not end up as a commit in a near future.

comment:4 Changed 4 years ago by lukeplant

  • Resolution set to duplicate
  • Status changed from reopened to closed

Sorry, I understand why you are re-opening, but I'm going to close again.

This isn't actually a 'tiny' ticket. There are two possibilities: 1) either we add documentation, in which case this new method becomes public API, which we can't change without a full deprecation cycle, which usually lasts several years, or 2) we leave it as it is without docs, which means that your problem is not really solved - "docs or it doesn't exist". Without docs, we are free to remove the method, and almost certainly will we revise widget rendering. It really doesn't make sense for us to build in customisation for one tiny part of one widget, and commit to maintaining that.

The alternative to this patch is that you override the whole of the render() method, which will work fine.

Note: See TracTickets for help on using tickets.
Back to Top