<s> from __future__ import unicode_literals <EOL> from django . db import migrations , models <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> def fill_in_worker_on_time_entries ( apps , schema_editor ) : <EOL> TimeEntry = apps . get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> for time_entry in TimeEntry . objects . all ( ) : <EOL> if time_entry . assignment . worker is None : <EOL> print ( '<STR_LIT>' . format ( <EOL> time_entry . assignment . id ) ) <EOL> time_entry . worker = time_entry . assignment . worker <EOL> time_entry . save ( ) <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . RunPython ( fill_in_worker_on_time_entries ) , <EOL> ] </s>
