Django database objects not displaying
<p>I keep getting <code>&lt;QuerySet [&lt;Member:  - &gt;]&gt;</code> whenever I try to display all objects within a model class through <code>Member.objects.all()</code> in the shell.</p>

<p>This is my code, note that the Book class is displaying them correctly when I call all objects, but the Member class does not:</p>

<pre><code>class Book(models.Model):
    Titel = models.CharField(max_length=100)
    Author = models.CharField(max_length=100)
    Genre = models.CharField(max_length=100)
    ISBN13 = models.CharField(max_length=13)

    def __str__(self):
        return self.Author + ' - ' + self.Titel

class Member(models.Model):
    Name = models.CharField(max_length=15)
    Surname = models.CharField(max_length=15)
    Mailadres = models.CharField(max_length=15)
    Birth = models.DateField(auto_now_add=True, auto_now=False)
    Leerlingnummer = models.CharField(max_length=15)

    def __str__(self):
        return self.Name + ' - ' + self.Surname
</code></pre>

<p>As requested the way I add members:</p>

<pre><code>from dashboard.models import Member
a = Member()
Name = 'xxx'
Surname = 'xxx'
Mailadres = 'xxxxxxx'
Birth = 'xx-xx-xxxx'
Leerlingnummer = 'xxxxxxxxx'
a.save()
</code></pre>

<p>You are just creating some variables. You have to assign to the attributes of the object you created and actually save it.</p>

<pre><code>from dashboard.models import Member
a = Member()
a.Name = 'xxx'
a.Surname = 'xxx'
a.Mailadres = 'xxxxxxx'
a.Birth = 'xx-xx-xxxx'
a.Leerlingnummer = 'xxxxxxxxx'
a.save()
</code></pre>

<p>Alternatively, you can use <code>Member.objects.create</code>:</p>

<pre><code>from dashboard.models import Member
a = Member.objects.create(
        Name='xxx',
        Surname='xxx',
        Mailadres='xxxxxxx',
        Birth='xx-xx-xxxx',
        Leerlingnummer='xxxxxxxxx')
</code></pre>

python django database shell object