Re: Overriding Class-based View Form Validation

2015-01-02 Thread Greg Back
1] > https://docs.djangoproject.com/en/1.7/ref/class-based-views/mixins-editing/#django.views.generic.edit.FormMixin.get_form_kwargs > > On 11 December 2014 at 09:26, Greg Back > > wrote: >> >> Sorry, I accidentally sent this before finishing the background. What I &

Re: Overriding Class-based View Form Validation

2014-12-10 Thread Greg Back
Sorry, I accidentally sent this before finishing the background. What I meant to say: I am writing an application where a model (I'll call it `Thing`) has a ForeignKey to User and a CharField ("name"), among some other fields. I would like "name" to be unique for any given user; I'm using `uni

Overriding Class-based View Form Validation

2014-12-10 Thread Greg Back
Hello- I was wondering if it would be reasonable to modify the `django.views.generic.edit.ProcessFormView` class, such that the `post()` function calls a (hypothetical) `self.validate_form(form)` function rather than directly calling `form.is_valid()`. The default implementation of `validate_f