def _dump_model(model, attrs=None):
 for field in model._meta.fields:
  print ('%s=%s,' % (field.name, str(getattr(model, field.name)))),
 if (attrs is not None):
  for attr in attrs:
   print ('%s=%s,' % (attr, str(getattr(model, attr)))),
 for field in model._meta.many_to_many:
  vals = getattr(model, field.name)
  print ('%s=%s (%i),' % (field.name, ', '.join(map(str, vals.all())), vals.count())),
 print

def _dump_model ( model , attrs = None ) : for field in model . _meta . fields : print ( '%s=%s,' % ( field . name , str ( getattr ( model , field . name ) ) ) ) , if ( attrs is not None ) : for attr in attrs : print ( '%s=%s,' % ( attr , str ( getattr ( model , attr ) ) ) ) , for field in model . _meta . many_to_many : vals = getattr ( model , field . name ) print ( '%s=%s (%i),' % ( field . name , ', ' . join ( map ( str , vals . all ( ) ) ) , vals . count ( ) ) ) , print
dump the model fields for debugging .