(self)
After report is saved, make sure positions are sane
After report is saved, make sure positions are sane
After report is saved make sure positions are sane
def check_report_display_field_positions(self):
        """ After report is saved, make sure positions are sane
        """
        for i, display_field in enumerate(self.displayfield_set.all()):
            if display_field.position != i + 1:
                display_field.position = i + 1
                display_field.save()
def check_report_display_field_positions ( self ) : for i , display_field in enumerate ( self . displayfield_set . all ( ) ) : if display_field . position != i + 1 : display_field . position = i + 1 display_field . save ( )