Re: formfield_overrides doesn't work

2019-05-12 Thread Tim Johnson
* Jim Illback [190512 14:22]: > Tim, this won’t help you to use or solve the formfield_overrides issues, but > maybe it will be helpful. I’ve not tried this for a CharField, but it works > great on a TextField (which has no max_length, so model size isn’t impacted): > > 1. Install widget

Re: formfield_overrides doesn't work

2019-05-12 Thread Jim Illback
Tim, this won’t help you to use or solve the formfield_overrides issues, but maybe it will be helpful. I’ve not tried this for a CharField, but it works great on a TextField (which has no max_length, so model size isn’t impacted): 1. Install widget tweaks and add {% load widget_tweaks %} at

Re: formfield_overrides doesn't work

2019-05-12 Thread Tim Johnson
* Joe Reitman [190512 13:34]: > Tim, > > I found this in the Django source code on Github searching for > 'formfield_overrides'. It is in a test module testing formfield_overrides > functionality. I'm assuming you imported TextInput from forms? This should > work to change your *admin*

Re: formfield_overrides doesn't work

2019-05-12 Thread Joe Reitman
Tim, I found this in the Django source code on Github searching for 'formfield_overrides'. It is in a test module testing formfield_overrides functionality. I'm assuming you imported TextInput from forms? This should work to change your *admin* display. Are trying to change your Admin panel

Re: formfield_overrides doesn't work

2019-05-12 Thread Tim Johnson
* Joe Reitman [190512 10:31]: > Tim, > > Here is an example of a custom form field limiting the input to 100 > characters. The model is defined to accept 255 chars. BTW, the text widget > 'attrs' sets the HTML form element attributes. > > class SearchForm(forms.Form): > > search_for =

Re: formfield_overrides doesn't work

2019-05-12 Thread Joe Reitman
Tim, Here is an example of a custom form field limiting the input to 100 characters. The model is defined to accept 255 chars. BTW, the text widget 'attrs' sets the HTML form element attributes. class SearchForm(forms.Form): search_for = forms.CharField( label='', label_suffix='',

Re: formfield_overrides doesn't work

2019-05-11 Thread Tim Johnson
* Tim Johnson [190511 11:20]: > django 2.1.5 with python 3.7.2 > > I have a models.py class as follows: > class Article(models.Model): > title = models.CharField(max_length=255,) > > And I want to override the rendered default size attribute to 100 in > the input/text form field. >

formfield_overrides doesn't work

2019-05-11 Thread Tim Johnson
django 2.1.5 with python 3.7.2 I have a models.py class as follows: class Article(models.Model): title = models.CharField(max_length=255,) And I want to override the rendered default size attribute to 100 in the input/text form field. the template rendering is done as follows