Re: Formset: 'ArticleForm' object does not support item assignment

2010-03-06 Thread coco
AND THE ANSWER IS : [...] if formset.is_valid(): # do something with the formset.cleaned_data cd = formset.cleaned_data for i in range(len(cd)): cd[i]['answer'] = cd[i]['x'] + cd[i]['y'] formset = ArticleFormSet(initial=cd) [...] -- You received this message because yo

Re: Formset: 'ArticleForm' object does not support item assignment

2010-03-05 Thread coco
Getting out of the bed, I partly found why this new problem occurs. This is because the following HTML line: Becomes this after the first submit by the browser: Then I loose "id_form-0" substring and the corrupted HTML cannot work twice. This seem encouraging, but now I need to sleep. I will p

Re: Formset: 'ArticleForm' object does not support item assignment

2010-03-05 Thread coco
I made some progress replacing the defective line with: formset.forms[i] = ArticleForm(cd[i]) Mysteriously: it work when the browser send the first submit. But the form becomes empty if I submit twice. Here is the template: Test Test {% if form.errors %}

Formset: 'ArticleForm' object does not support item assignment

2010-03-05 Thread coco
Good evening, I stick with the above error message in the following example. I looked at each attributes of the object (Base_fields, etc.), but I can't find how I to assign the new dataset back into the form. def manage_articles(request): ArticleFormSet = formset_factory(ArticleForm) if r

Re: ListField() wanted or how to use iterable fields in forms

2010-03-04 Thread coco
It works! Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visi

ListField() wanted or how to use iterable fields in forms

2010-03-03 Thread coco
Hello, Is it possible to get some kind of ListField() for some django.forms.Form fields ? Here is a typical example problem involving this. Let's try to make the following kind of form (forms.py): class mytable(forms.Form): tags = forms.CharField() x = forms.FloatField() y = forms.Flo

How to deal with "IndentationError"

2008-05-19 Thread coco
Hi list, IndentationError unindent does not match any outer indentation level (views.py, line 681) Request Method: GET Request URL: http://www.magicparis.com/webs/ Exception Type: IndentationError Exception Value: unindent does not match any outer indentation level (views.py, line 681) Exception

OperationalError (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='") Why

2008-05-18 Thread coco
Hi List, Django show this message to me: OperationalError at /champselysees/services/ (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='") Request Method: GET Request URL: http://www.champselysees.org/champselysees/services/ Exception