(self, sql_object)
Migrate submodels from the Couch model to the SQL model. This is called
        as part of ``_migration_sync_to_sql``
Migrate submodels from the Couch model to the SQL model. This is called
        as part of ``_migration_sync_to_sql``
Migrate submodels from the Couch model to the SQL model . This is called as part of _migration_sync_to_sql
def _migration_sync_submodels_to_sql(self, sql_object):
        """Migrate submodels from the Couch model to the SQL model. This is called
        as part of ``_migration_sync_to_sql``"""
        for spec in self._migration_get_submodels():
            sql_submodels = []
            for couch_submodel in getattr(self, spec.couch_attr):
                sql_fields = {
                    sql_field: getattr(couch_submodel, couch_field)
                    for couch_field, sql_field in zip(spec.couch_fields, spec.sql_fields)
                }
                sql_submodels.append(spec.sql_class(**sql_fields))
            sql_attr = getattr(sql_object, spec.sql_attr)
            sql_attr.all().delete()
            sql_attr.set(sql_submodels, bulk=False)
def _migration_sync_submodels_to_sql ( self , sql_object ) : for spec in self . _migration_get_submodels ( ) : sql_submodels = [ ] for couch_submodel in getattr ( self , spec . couch_attr ) : sql_fields = { sql_field : getattr ( couch_submodel , couch_field ) for couch_field , sql_field in zip ( spec . couch_fields , spec . sql_fields ) } sql_submodels . append ( spec . sql_class ( * * sql_fields ) ) sql_attr = getattr ( sql_object , spec . sql_attr ) sql_attr . all ( ) . delete ( ) sql_attr . set ( sql_submodels , bulk = False )