DISQUS

Django Aware: Clearing Django Form Fields One By One

  • Foo · 1 year ago
    And self.data['some_field'] is an instance variable in what class?
  • Malcolm Tredinnick · 1 year ago
    Now, my intuition arguably works differently from others, but I'd argue that this approach is slightly backwards. It certainly works and I can't see it ever failing, but on some level it's coupling input to output more than you might prefer. Altering the submitted data is the wrong end of the pipeline. The end goal is never to render that piece of data, which is a property of the form.

    I'll eventually write this up for the docs (or you could beat me to it and submit a patch), but here's my preferred approach to this kind of problem: http://groups.google.com/group/django-users/bro...
  • Alex Gaynor · 1 year ago
    I'd just create a custom widget with a render_value kwarg like the password widget does:

    http://code.djangoproject.com/browser/django/tr...
  • williyamb · 8 months ago
    Ecommerce Web Design Ecommerce Web Design
  • John Parker · 8 months ago
    I agree with what you have to say.....
  • John Parker · 8 months ago
  • Apple Mac Computers · 7 months ago
    i have a method that will take the two parameters which checks for the validity of the user.if such is a case what should be used ie, an abstract class or an interface for the method