title: How do you modify the default widget for all builtin form fields of a certain type in Django?
body: <p>This is a follow-up on <a href="https://stackoverflow.com/questions/660929">How do you change the default widget for all Django date fields in a ModelForm?</a>.</p>
  
  <p>Suppose you have a very large number of models (e.g. A-ZZZ) that is growing with the input of other developers that are beyond your control, and you want to change the way all date fields are entered (i.e. by using jQueryUI). What's the best way to ensure that all date fields are filled out using that new widget?</p>
  
  <p>One suggestion from the cited question was:</p>
  
  <pre><code>def make_custom_datefield(f):
     if isinstance(f, models.DateField):
         # return form field with your custom widget here...
     else:
         return f.formfield()
  
  class SomeForm(forms.ModelForm): 
     formfield_callback = make_custom_datefield
  
     class Meta:
         # normal modelform stuff here...
  </code></pre>
  
  <p>However, is this possible to do where you don't have explicit ModelForm's, but url patterns come from models directly? i.e. your url config is likeso:</p>
  
  <pre><code>url(r'^A/?$', 'list_detail.object_list', SomeModelA)
  </code></pre>
  
  <p>where SomeModelA is a model (not a form) that's turned into a ModelForm by Django in the background.</p>
  
  <p>At present in my system there are no Forms for each Model. The only point of creating forms explicitly would be to add the formfield_callback suggested in the prior solution, but that goes against DRY principles, and would be error prone and labour intensive.</p>
  
  <p>I've considered (as suggested in the last thread) creating my own field that has a special widget and using that instead of the builtin. It's not so labour intensive, but it could be subject to errors (nothing a good grep couldn't fix, though).</p>
  
  <p>Suggestions and thoughts are appreciated.</p>