Ticket #8440: auto_id.diff

File auto_id.diff, 2.1 KB (added by cdleary@…, 16 years ago)

Simple proposal auto_id patch.

  • forms/formsets.py

     
    2828    """
    2929    A collection of instances of the same Form class.
    3030    """
    31     def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
     31    def __init__(self, data=None, files=None, auto_id='id-%s', prefix=None,
    3232                 initial=None, error_class=ErrorList):
    3333        self.is_bound = data is not None or files is not None
    3434        self.prefix = prefix or 'form'
  • forms/models.py

     
    184184        return new_class
    185185
    186186class BaseModelForm(BaseForm):
    187     def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
     187    def __init__(self, data=None, files=None, auto_id='id-%s', prefix=None,
    188188                 initial=None, error_class=ErrorList, label_suffix=':',
    189189                 empty_permitted=False, instance=None):
    190190        opts = self._meta
     
    240240    """
    241241    model = None
    242242
    243     def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
     243    def __init__(self, data=None, files=None, auto_id='id-%s', prefix=None,
    244244                 queryset=None, **kwargs):
    245245        self.queryset = queryset
    246246        defaults = {'data': data, 'files': files, 'auto_id': auto_id, 'prefix': prefix}
  • forms/forms.py

     
    6868    # class is different than Form. See the comments by the Form class for more
    6969    # information. Any improvements to the form API should be made to *this*
    7070    # class, not to the Form class.
    71     def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
     71    def __init__(self, data=None, files=None, auto_id='id-%s', prefix=None,
    7272                 initial=None, error_class=ErrorList, label_suffix=':',
    7373                 empty_permitted=False):
    7474        self.is_bound = data is not None or files is not None
Back to Top