Django: import Topic Issue, word Topic shows instead of title?
<p>Hey guys I just began working through the Django section in the Python Crash Course. I'm making a learning log in which you can add entries. I followed the book but I'm having one odd issue. When I add a new topic instead of the title for a new topic I literally get the word Topic</p>

<p><a href="http://i.stack.imgur.com/HN4VA.png" rel="nofollow"><img src="http://i.stack.imgur.com/HN4VA.png" alt="Topic Issue"></a></p>

<p>My code is so far as follows, under admin.py </p>

<pre><code>from django.contrib import admin
from learning_logs.models import Topic 

admin.site.register(Topic)
</code></pre>

<p>This is my models.py </p>

<pre><code>from django.db import models

# Create your models here.

class Topic(models.Model):
    """A topic the user is learning about """
    text = models.CharField(max_length=200)
    date_added = models.DateTimeField(auto_now_add=True)

    def _str_(self):
        """Returns a  string representation of the model """
        return self.text 
</code></pre>

<p>the code matches the book, any idea why this is happening? </p>

<p>You need two underscores for the str method, not one:</p>

<pre><code># No
def _str_(self):
   pass

# Yes
def __str__(self):
   pass
</code></pre>

python django django-models