Django(trunk) and class based generic views: one form's initial data appearing in another one's

前端 未结 2 340
难免孤独
难免孤独 2021-01-28 02:45

I\'ve run into a strange problem where data seems to persist accross different views and requests until the server gets restarted.

I\'ve managed to reduce the issue to t

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-28 03:16

    You might want to specify Django-1.3 development, generic class view doesn't exist in Django 1.2.5. In your forms.py file, can you comment the following lines and try again:

    class UpdateForm(forms.ModelForm):
        class Meta:
            model = Foo
    
        def __init__(self, *args, **kwargs):
            #kwargs.setdefault('initial', {})
            #kwargs['initial'].update({'bug': 'WHY??'})
            super(UpdateForm, self).__init__(*args, **kwargs)
    

提交回复
热议问题