#NEWLINE# def populate_display_field( apps , schema_editor ) : #NEWLINE# #INDENT# Category = apps . get_model ( 'categories' , 'Category' ) #NEWLINE# for category in Category . objects . all ( ) : #NEWLINE# #INDENT# if ( category . display_field is not None ) : #NEWLINE# #INDENT# for obs in Observation . objects . filter ( category = category ) : #NEWLINE# #INDENT# obs . update_display_field ( ) #NEWLINE# obs . save ( )