Re: Should it be possible to change mymodelforminstance.cleaned_data after having run mymodelforminstance.is_valid()?

2010-06-16 Thread Peter Bengtsson
On 16 June 2010 13:53, George Sakkis wrote: > On Jun 16, 4:22 pm, Peter Bengtsson wrote: > >> I have a modelform where I change the cleaned_data dict after I have >> run is_valid() and I'm not sure if this is the totally wrong way of >> doing things or if it

Should it be possible to change mymodelforminstance.cleaned_data after having run mymodelforminstance.is_valid()?

2010-06-16 Thread Peter Bengtsson
I have a modelform where I change the cleaned_data dict after I have run is_valid() and I'm not sure if this is the totally wrong way of doing things or if it's a bug. My code broke when I upgraded to 1.2 so it did work back in the 1.1 days. # models.py class Person(models.Model): name = model

Re: ModelForms and ForeignKeys causing ValueError

2010-06-16 Thread Peter Bengtsson
Submitted here: http://code.djangoproject.com/ticket/13776 On Jun 14, 2:05 pm, Karen Tracey wrote: > On Mon, Jun 14, 2010 at 12:39 PM, Peter Bengtsson wrote: > > I'm happy to submit a ticket but wanted to check first that I'm doing > > the right thing. I think this u

ModelForms and ForeignKeys causing ValueError

2010-06-14 Thread Peter Bengtsson
I'm happy to submit a ticket but wanted to check first that I'm doing the right thing. I think this used to work in Django 1.1 but not now in trunk. I can better explain it with code: # models.py class FooBarModel(models.Model): name = models.CharField(max_length=10) age = models.IntegerF

Re: Beating on an old issue; counter intuitive cascade deletes on foreign keys

2010-06-10 Thread Peter Bengtsson
delete with a query set. > > I opened a new ticket: > > http://code.djangoproject.com/ticket/13731 > >  Thomas > > Russell Keith-Magee wrote: >> On Wed, Jun 9, 2010 at 3:53 AM, Peter Bengtsson wrote: >>> On 8 June 2010 13:09, Jeremy Dunck wrote: >>>

Re: Beating on an old issue; counter intuitive cascade deletes on foreign keys

2010-06-08 Thread Peter Bengtsson
On 8 June 2010 13:09, Jeremy Dunck wrote: > On Tue, Jun 8, 2010 at 7:30 AM, Peter Bengtsson wrote: >> I've now had to learn this the hard way by having real live data >> deleted from my database on two production projects and it pisses me >> off big time every time. &

Beating on an old issue; counter intuitive cascade deletes on foreign keys

2010-06-08 Thread Peter Bengtsson
I've now had to learn this the hard way by having real live data deleted from my database on two production projects and it pisses me off big time every time. I can accept that NOT nullable foreign relations cascade the delete but not if they have null=True on them. Example: class Survey(Models):

Re: Help me write tests for my patch on template rendering

2009-10-21 Thread Peter Bengtsson
Thanks for the help. Patch uploaded http://code.djangoproject.com/ticket/11421 On Oct 21, 6:49 pm, Peter Bengtsson wrote: > On 21 Oct, 16:34, Jacob Kaplan-Moss wrote:> On Wed, Oct > 21, 2009 at 9:29 AM, Peter Bengtsson wrote: > > > But how do I run these? It takes many m

Re: Help me write tests for my patch on template rendering

2009-10-21 Thread Peter Bengtsson
On 21 Oct, 16:34, Jacob Kaplan-Moss wrote: > On Wed, Oct 21, 2009 at 9:29 AM, Peter Bengtsson wrote: > > But how do I run these? It takes many many seconds to run the whole > > suite. > > Seehttp://ericholscher.com/blog/2009/oct/16/easy-running-django-test-suite/ >

Help me write tests for my patch on template rendering

2009-10-21 Thread Peter Bengtsson
(Sorry about the vague subject line) I've written a patch that fixes this: http://code.djangoproject.com/ticket/11421 But so far only for AttributeErrors. But I don't want to submit the patch until I've got tests for it. Can someone guide me through the jungle of Django tests to run and write a