How to add more space in `__str__` method of Django model?
<p>I want to add more spaces to <code>__str__</code> method, but method cut off spaces to 1.</p>

<p>For example:</p>

<pre><code>class Spam(models.Model):
    foo = models.IntegerField()
    bar = models.IntegerField()

    def __str__(self):
        return 'more spaces {}            {}!'.format(self.foo, self.bar)
</code></pre>

<p>This output in Django admin:
<code>more spaces 1 2</code></p>

<p>I want : <code>more spaces 1            2</code></p>

<p>How do this?</p>

<p>I am not familiar with django, but you are checking the results at web-page, indeed.</p>

<p>So full answer for your question will be:
You should use special HTML symbols for HTML-page to indent your second part of text. You can check special symbols here: <a href="http://www.wikihow.com/Insert-Spaces-in-HTML" rel="nofollow">http://www.wikihow.com/Insert-Spaces-in-HTML</a></p>

<p>To use '&amp;nbsp' you can do:</p>

<pre><code>def __str__(self):
    space_sym = "&amp;nbsp"*10 # hardcode magic-number of indent spaces
    return 'more spaces {}{}{}!'.format(self.foo, space_sym, self.bar)
</code></pre>

python django