Hi, Anybody has an idea about this?
Thanks james On Aug 24, 3:27 pm, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > I am using defaultdict to gather organize some data on request.POST. > but the result seems to be different when execute outside django ... > > inside django I could get this result ... > > {u'item': [u'727'], u'unit_price': [u'5.50'], u'qty': [u'']} > {u'item': [u'2'], u'unit_price': [u'23500.00'], u'qty': [u'']} > {u'item': [u'1'], u'unit_price': [u'10000.00'], u'qty': [u'']} > > while outside django I could get this result > > {u'item': u'727], u'unit_price': u'5.50', u'qty': u''} > {u'item': u'2', u'unit_price': u'23500.00', u'qty': u''} > {u'item': u'1', u'unit_price': u'10000.00', u'qty': u''} > > here is my script ... > > for k, v in request.POST.iteritems(): > if k.startswith('line'): > new_k = k.split('.',1)[0] > items[new_k][k.split('.',1)[1]] = > v > for k, v in items.items(): > id = 'line%s.' % str(len(fd_list)+1) > fd_list.append(InvoiceItemForm(v, auto_id=id+'%s')) > > the difference makes creating a newform into error > > Thanks > james --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---