readonly and autofocus support in form fields?

2017-01-18 Thread Norberto Bensa
Hello, I usually need to make form fields readonly or autofocus (the app I'm developing right now has a lot of these). While I can do it in the form or a custom field, I'm wondering why there's no support for these attributes out-of-the-box (btw, there's support for disabled). TIA, Norberto --

Re: form_invalid

2017-01-29 Thread Norberto Bensa
https://ccbv.co.uk is your friend with class based views. I'd override post(self, request, *args, **kwargs), in request.POST, you'll have your form's data (before it's validated). HTH, Norberto 2017-01-29 9:10 GMT-03:00 Roberto Russi : > I need get data from a form when submit is clicked even i

Re: form_invalid

2017-01-29 Thread Norberto Bensa
> > > Il giorno domenica 29 gennaio 2017 18:30:50 UTC+1, Norberto Bensa ha scritto: >> >> https://ccbv.co.uk is your friend with class based views. >> >> I'd override post(self, request, *args, **kwargs), in request.POST, you'll >> have your form

Re: form_invalid

2017-01-29 Thread Norberto Bensa
ver form also if 'save' > button is clicked and required fields are not filled. > > Il giorno domenica 29 gennaio 2017 20:26:10 UTC+1, Norberto Bensa ha > scritto: >> >> Are you telling me the following doesn't work for you? >> >> class DemoCreateVi

Re: form_invalid

2017-01-29 Thread Norberto Bensa
BTW, IIRC, you can also make your model fields required (for db consistency) but then you need to use django.forms.Form instead of django.forms.ModelForm. 2017-01-30 0:08 GMT-03:00 Norberto Bensa : > Then you need to make your model fields not required and override your > form.clean() m

"last_login", null=True not migrated

2016-01-05 Thread Norberto Bensa
Hello, I have a project originally developed using Django 1.5 but upgraded up to 1.9.1. It uses a custom user model (from AbstractUser). Yesterday I had to create a user and Django replied with an exception. After some googling, this exception was caused because last_login can now be None whil