Add comma formatting to counts within import warning diff emails

This commit is contained in:
Lance Edgar 2016-05-23 14:21:07 -05:00
parent 00a8e2657c
commit f6cf0e5971

View file

@ -65,7 +65,7 @@
% for model, (created, updated, deleted) in changes.iteritems(): % for model, (created, updated, deleted) in changes.iteritems():
<li> <li>
<a href="#${model}">${model}</a> <a href="#${model}">${model}</a>
- ${len(created)} created, ${len(updated)} updated, ${len(deleted)} deleted - ${'{:,d}'.format(len(created))} created, ${'{:,d}'.format(len(updated))} updated, ${'{:,d}'.format(len(deleted))} deleted
</li> </li>
% endfor % endfor
</ul> </ul>
@ -78,7 +78,7 @@
% for model, (created, updated, deleted) in changes.iteritems(): % for model, (created, updated, deleted) in changes.iteritems():
<h4> <h4>
<a name="${model}">${model}</a> <a name="${model}">${model}</a>
- ${len(created)} created, ${len(updated)} updated, ${len(deleted)} deleted - ${'{:,d}'.format(len(created))} created, ${'{:,d}'.format(len(updated))} updated, ${'{:,d}'.format(len(deleted))} deleted
</h4> </h4>
% for instance, host_data in created[:max_display]: % for instance, host_data in created[:max_display]:
@ -103,7 +103,7 @@
</table> </table>
% endfor % endfor
% if len(created) > max_display: % if len(created) > max_display:
<h5>${model} - there were ${len(created) - max_display} other additions which are not shown here</h5> <h5>${model} - there were ${'{:,d}'.format(len(created) - max_display)} other additions which are not shown here</h5>
% endif % endif
% for instance, local_data, host_data in updated[:max_display]: % for instance, local_data, host_data in updated[:max_display]:
@ -128,7 +128,7 @@
</table> </table>
% endfor % endfor
% if len(updated) > max_display: % if len(updated) > max_display:
<h5>${model} - there were ${len(updated) - max_display} other updates which are not shown here</h5> <h5>${model} - there were ${'{:,d}'.format(len(updated) - max_display)} other updates which are not shown here</h5>
% endif % endif
% for instance, local_data in deleted[:max_display]: % for instance, local_data in deleted[:max_display]:
@ -153,7 +153,7 @@
</table> </table>
% endfor % endfor
% if len(deleted) > max_display: % if len(deleted) > max_display:
<h5>${model} - there were ${len(deleted) - max_display} other deletions which are not shown here</h5> <h5>${model} - there were ${'{:,d}'.format(len(deleted) - max_display)} other deletions which are not shown here</h5>
% endif % endif
% endfor % endfor