<pre>
for network in rack.network_set.order_by('name')[:1]:
    next_hostname = get_next_free_hostname(network.data_center)
    if next_hostname:
        help_text = 'Next available hostname in this DC: %s' % next_hostname
        self.fields['name'].help_text = help_text
        break
</pre>