def prepare_asides_to_store(asides_source):
 asides = None
 if asides_source:
  asides = []
  for asd in asides_source:
   aside_fields = {}
   for (asd_field_key, asd_field_val) in asd.fields.iteritems():
    aside_fields[asd_field_key] = asd_field_val.read_from(asd)
   asides.append({'aside_type': asd.scope_ids.block_type, 'fields': aside_fields})
 return asides

def prepare_asides_to_store ( asides_source ) : asides = None if asides_source : asides = [ ] for asd in asides_source : aside_fields = { } for ( asd_field_key , asd_field_val ) in asd . fields . iteritems ( ) : aside_fields [ asd_field_key ] = asd_field_val . read_from ( asd ) asides . append ( { 'aside_type' : asd . scope_ids . block_type , 'fields' : aside_fields } ) return asides
convert asides xblocks objects to the list of dicts .