Re: Validate a form's excluded fields if a value is present

2010-04-04 Thread orokusaki
I've been brainstorming (ie, drinking more coffee than I should), and what I came up with to be the best (IMHO) solution for A) Less confusion, and B) Less risk of API breakage is: ModelForm.is_valid(include_all_fields=True) or ModelForm.is_all_fields_valid() and neither are going to be an issu

Re: Validate a form's excluded fields if a value is present

2010-04-03 Thread Russell Keith-Magee
On Sat, Apr 3, 2010 at 3:03 PM, orokusaki wrote: > Russ, > > I think you're 100% right, and the "wrong place" part hit the nail on > the head. This morning I got really frustrated because I couldn't > quite see the big picure yet pertaining to the ORM and it's > relationship with ModelForm, partly

Re: Validate a form's excluded fields if a value is present

2010-04-03 Thread Russell Keith-Magee
On Sat, Apr 3, 2010 at 8:14 AM, Boris Schaeling wrote: > On Thu, 01 Apr 2010 11:11:47 +0300, Russell Keith-Magee > wrote: > >> [...]I don't deny that it would be *really* nice to be able to >> automatically call full model validation on a model on form save - the >> problem is that we can't do th

Re: Validate a form's excluded fields if a value is present

2010-04-03 Thread orokusaki
Russ, I think you're 100% right, and the "wrong place" part hit the nail on the head. This morning I got really frustrated because I couldn't quite see the big picure yet pertaining to the ORM and it's relationship with ModelForm, partly because there is so much going on with state changes and you

Re: Validate a form's excluded fields if a value is present

2010-04-02 Thread Boris Schaeling
On Thu, 01 Apr 2010 11:11:47 +0300, Russell Keith-Magee wrote: [...]I don't deny that it would be *really* nice to be able to automatically call full model validation on a model on form save - the problem is that we can't do that while retaining backwards compatibility. How about a setting

Re: Validate a form's excluded fields if a value is present

2010-04-02 Thread Russell Keith-Magee
On Sat, Apr 3, 2010 at 2:51 AM, orokusaki wrote: > On Apr 2, 2:00 am, Russell Keith-Magee wrote: > >> The broad goal is certainly reasonable and desirable. It's really a >> matter of finding a way to make it work that doesn't involve >> completely breaking (or disfiguring) the API that we already

Re: Validate a form's excluded fields if a value is present

2010-04-02 Thread orokusaki
On Apr 2, 2:00 am, Russell Keith-Magee wrote: > The broad goal is certainly reasonable and desirable. It's really a > matter of finding a way to make it work that doesn't involve > completely breaking (or disfiguring) the API that we already have. > > Yours, > Russ Magee %-) I've been working on

Re: Validate a form's excluded fields if a value is present

2010-04-02 Thread Russell Keith-Magee
On Fri, Apr 2, 2010 at 6:25 AM, orokusaki wrote: > Hey Russ, > > I'm not on the model.full_clean stuff anymore, and I apologize for > burning so many cycles on that point when you're in the middle of 1.2 > dev. I'm just wondering if what I proposed above sounds reasonable. > The form validation tu

Re: Validate a form's excluded fields if a value is present

2010-04-01 Thread orokusaki
Thanks Jacob, I'll give that a try. On Apr 1, 7:44 am, Jacob Kaplan-Moss wrote: > On Thu, Apr 1, 2010 at 3:11 AM, Russell Keith-Magee > > wrote: > > Melodrama aside, as we've told you before, the docs clearly say that > > full_clean() isn't called by form.save(). The docs also give you the > > r

Re: Validate a form's excluded fields if a value is present

2010-04-01 Thread orokusaki
Hey Russ, I'm not on the model.full_clean stuff anymore, and I apologize for burning so many cycles on that point when you're in the middle of 1.2 dev. I'm just wondering if what I proposed above sounds reasonable. The form validation turned off completely for fields that aren't included makes it

Re: Validate a form's excluded fields if a value is present

2010-04-01 Thread Jacob Kaplan-Moss
On Thu, Apr 1, 2010 at 3:11 AM, Russell Keith-Magee wrote: > Melodrama aside, as we've told you before, the docs clearly say that > full_clean() isn't called by form.save(). The docs also give you the > reason - backwards compatibility. > > I don't deny that it would be *really* nice to be able to

Re: Validate a form's excluded fields if a value is present

2010-04-01 Thread Russell Keith-Magee
On Thu, Apr 1, 2010 at 9:11 AM, orokusaki wrote: > I'm working on an SAAS project, and there is an ``account`` attribute > (foreign key) on every model in the project (similar to those who have > a ``user`` or ``created_by`` attribute on every model). ``account`` is > added to the request object u

Re: Validate a form's excluded fields if a value is present

2010-04-01 Thread Russell Keith-Magee
On Thu, Apr 1, 2010 at 2:17 PM, subs...@gmail.com wrote: > Seems like a security hole, whereby people may supply additional > fields if they can guess their counterparts on the model. Its > 'exclude', not 'exclude_maybe'. Please be *very* careful about using the words "security hole" - those word

Re: Validate a form's excluded fields if a value is present

2010-03-31 Thread subs...@gmail.com
Seems like a security hole, whereby people may supply additional fields if they can guess their counterparts on the model. Its 'exclude', not 'exclude_maybe'. ...Unless I'm missing something fundamental. -S On Mar 31, 9:11 pm, orokusaki wrote: > I'm working on an SAAS project, and there is an `

Re: Validate a form's excluded fields if a value is present

2010-03-31 Thread orokusaki
Let me just say that my non-patch above is just an abstract idea, and I don't know if it will work like that without other changes, but I think it gets the idea across. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group,

Validate a form's excluded fields if a value is present

2010-03-31 Thread orokusaki
I'm working on an SAAS project, and there is an ``account`` attribute (foreign key) on every model in the project (similar to those who have a ``user`` or ``created_by`` attribute on every model). ``account`` is added to the request object using a MiddleWare class. When I'm writing views, I have t