#18133: global settings for label_suffix
-------------------------------------+-------------------------------------
     Reporter:  Evil Clay            |                    Owner:  nobody
  <clay.evil@…>                      |                   Status:  closed
         Type:  New feature          |                  Version:  1.4
    Component:  Uncategorized        |               Resolution:  invalid
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by russellm):

 * status:  new => closed
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0
 * resolution:   => invalid


Old description:

> hi, would it be possible to make label_suffix settable in settings file?
> now, if i want to change the suffix for the whole site, i have to have in
> my code something like this:
>
> class MyModelForm(forms.ModelForm):
>
>     def __init__(self, data=None, files=None, auto_id='id_%s',
> prefix=None,
>                  initial=None, error_class=ErrorList, label_suffix='',
>                  empty_permitted=False, instance=None):
>         super(MyModelForm, self).__init__(data, files, auto_id, prefix,
> initial,
>                                             error_class, label_suffix,
> empty_permitted, instance)
>

> class MyForm(forms.Form):
>
>     def __init__(self, data=None, files=None, auto_id='id_%s',
> prefix=None,
>                  initial=None, error_class=ErrorList, label_suffix='',
>                  empty_permitted=False):
>         super(MyForm, self).__init__(data, files, auto_id, prefix,
> initial,
>                                             error_class, label_suffix,
> empty_permitted)
>
> and then inherit all my forms from this classes. But this is rather a way
> around then a solution. Anyways it doesn't feel pretty.
> Thank you.

New description:

 hi, would it be possible to make label_suffix settable in settings file?
 now, if i want to change the suffix for the whole site, i have to have in
 my code something like this:
 {{{
 class MyModelForm(forms.ModelForm):

     def __init__(self, data=None, files=None, auto_id='id_%s',
 prefix=None,
                  initial=None, error_class=ErrorList, label_suffix='',
                  empty_permitted=False, instance=None):
         super(MyModelForm, self).__init__(data, files, auto_id, prefix,
 initial,
                                             error_class, label_suffix,
 empty_permitted, instance)
 }}}
 {{{
 class MyForm(forms.Form):

     def __init__(self, data=None, files=None, auto_id='id_%s',
 prefix=None,
                  initial=None, error_class=ErrorList, label_suffix='',
                  empty_permitted=False):
         super(MyForm, self).__init__(data, files, auto_id, prefix,
 initial,
                                             error_class, label_suffix,
 empty_permitted)
 }}}
 and then inherit all my forms from this classes. But this is rather a way
 around then a solution. Anyways it doesn't feel pretty.
 Thank you.

--

Comment:

 Fixed formatting of the ticket description. Please use preview.

 Again, as with #18134, you've suggested a solution that modifies API, but
 you haven't described the problem you're trying to solve, or the effect
 that the new label_suffix would have.

 Closing invalid; feel free to reopen if you care to provide more details.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18133#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to