<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations , IntegrityError <EOL> def rename_static_data_source_pillow_errors ( apps , schema_editor ) : <EOL> PillowError = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> old_name = '<STR_LIT>' <EOL> new_name = '<STR_LIT>' <EOL> for error_record in PillowError . objects . filter ( pillow = old_name ) : <EOL> try : <EOL> error_record . pillow = new_name <EOL> error_record . save ( ) <EOL> except IntegrityError : <EOL> error_record . delete ( ) <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . RunPython ( rename_static_data_source_pillow_errors ) <EOL> ] </s>
