Yeah it very well might be the case that I'm missing something or that some 
additional documentation is all we need (I'm not new to Django but far from 
an expert and took a long hiatus).

The first example is the label suffix, which seems to be given a hard coded 
default here 
<https://github.com/django/django/blob/129583a0d3cf69b08d058cd751d777588801b7ad/django/forms/forms.py#L78>.
  
I think there are many ways to override / deal with this, but if you're 
using a mix of Forms and ModelForms and want to still enjoy much of the 
magic of Django, what's the recommended solution to, say, remove that colon 
in all your forms?  Seems like you can... (1) Just manually write the 
labels yourself in the template (2) Create new base form classes that 
extend Form/ModelForm and remove the colon, and then make sure all your 
forms use those (3) Manually deal with this in form instantiation or via 
get_form() or some other method (4) Maybe more?

As a lay user, this all seems pretty complex to change something so 
seemingly simple and there doesn't seem to be a "recommended" way.

Another example is say, adding a class to every input field because you 
want to style them appropriately.  Solutions to this exist, but they again 
seem far from "plug n play", even when I'm guessing a majority of users 
want to do this (since if you're using Bootstrap, Foundation, Bulma, etc 
it's needed).

I have a few more examples but will stop there.  Let me know what you think.

On Tuesday, October 8, 2019 at 12:53:42 AM UTC-7, Carlton Gibson wrote:
>
> Hi Alex
>
> Can you be more specific please? 
>
> On Sunday, 6 October 2019 01:11:52 UTC+2, Alex Scott wrote:
>>
>> Would it be a terrible idea to allow these to be set in settings or in a 
>> base form that gets inherited by everything else?
>>
>
>  Without seeing exactly the problems you have in mind, it's hard to say... 
> — By using a base form class in your project, overriding templates, and/or 
> default field mappings, I would imagine everything you need is already 
> possible. 
>
> (Quite likely there's room for a deeper How To on advanced form 
> customisation in the docs though.)
>
> Kind Regards,
>
> Carlton
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/718e0ea1-5375-4c81-b0d2-5a2b6b742685%40googlegroups.com.
  • ... Alex Scott
    • ... Confi Yobo
    • ... Carlton Gibson
      • ... Alex Scott
    • ... Jacob Rief
      • ... Carlton Gibson
        • ... Carlton Gibson
        • ... Jacob Rief
    • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)

Reply via email to