def formset(*args, **kw):
 prefix = kw.pop('prefix', 'form')
 total_count = kw.pop('total_count', len(args))
 initial_count = kw.pop('initial_count', len(args))
 data = {(prefix + '-TOTAL_FORMS'): total_count, (prefix + '-INITIAL_FORMS'): initial_count}
 for (idx, d) in enumerate(args):
  data.update(((('%s-%s-%s' % (prefix, idx, k)), v) for (k, v) in d.items()))
 data.update(kw)
 return data

def formset ( * args , ** kw ) : prefix = kw . pop ( 'prefix' , 'form' ) total_count = kw . pop ( 'total_count' , len ( args ) ) initial_count = kw . pop ( 'initial_count' , len ( args ) ) data = { ( prefix + '-TOTAL_FORMS' ) : total_count , ( prefix + '-INITIAL_FORMS' ) : initial_count } for ( idx , d ) in enumerate ( args ) : data . update ( ( ( ( '%s-%s-%s' % ( prefix , idx , k ) ) , v ) for ( k , v ) in d . items ( ) ) ) data . update ( kw ) return data
build up a formset-happy post .