Re: Form customization

2019-10-12 Thread Jacob Rief
> > > Hi Jacob — Possibly. Sounds like a moderate change... — what would it look > like? — proof of concept. (As ever... :) > > Something similar such as the templatetag render_form from django-restframework ,

Re: Form customization

2019-10-11 Thread Carlton Gibson
A better link for the CSS class issue is this one https://docs.djangoproject.com/en/2.2/ref/forms/widgets/ On Fri, 11 Oct 2019 at 20:54, Carlton Gibson wrote: > HI Alex, > > For label_suffix, I'd say a base form class for your project is exactly > the way to go. > You can set CSS classes at th

Re: Form customization

2019-10-11 Thread Carlton Gibson
HI Alex, For label_suffix, I'd say a base form class for your project is exactly the way to go. You can set CSS classes at the field level[0] ... — I suspect the API is there, but maybe reviewing the guide[1] for where it's lacking might be good. There are also third-party options, such as C

Re: Form customization

2019-10-10 Thread '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
Try tri.forms maybe The main problem IMHO is that rendering is stuck in a template system, rather than components that could leverage the decorator pattern as it's known to be better for UI programing (cf. GoF, React & friends success) ‐‐‐ Original Message ‐‐‐ Le dimanche 6 octobre 2019

Re: Form customization

2019-10-10 Thread Jacob Rief
With Django-1.10 we got the ability to override form fields with our own templates, however the form structure is still hard-coded. Examples are BaseForm.as_table() , BaseForm.as_ul()

Re: Form customization

2019-10-10 Thread Alex Scott
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

Re: Form customization

2019-10-08 Thread Carlton Gibson
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 ha

Re: Form customization

2019-10-06 Thread Confi Yobo
I kind of support what you are saying Alex Scott, I think the form should be simplified at currently it takes a lot of time to setup a simple contact form. My suggestion is that upon creation of every form there should be properties and methods to allows you to customize the form. Simplifying the

Form customization

2019-10-05 Thread Alex Scott
Hi all, Are there any current plans or developments to allow better customization of forms? I've browsed several old Stack Overflow, django-users and Django ticket requests and it seems common enough to want to say, add a class to every form field or field label, or change the label suffix from "