views:

61

answers:

0

I have an Entry. There's a field, brotherEntry, that could point to another Entry. So when I show the form writeEntry, the user can select a brother entry from the list of entries already inserted. However, that list doesn't show all of them, just a few. I can't figure out why is doing that... Any idea?

#models.py
class Entry(models.Model):
    title = models.CharField(max_length=250)
    brotherEntry = models.ForeignKey('Entry', blank=True, null=True)

#views.py
class EntryForm(forms.ModelForm):
    class Meta:
      model = Entry

def writeEntry(request):
    entry = EntryForm()
    message = 'Some text'
    return render_to_response(
        'myadmin/write_post.html',
         {'entryForm':entry, 'message': message})

Thank you all!