Here is the relevant code:
models.py
class Blog(models.Model):
...
images = models.ManyToManyField('myapp.Image')
class Image(models.Model):
...
title = models.CharField(max_length=60, blank=True, null=True)
image = models.FileField(upload_to=content_file_name)
body = models.TextField(blank=True)
citation = models.URLField(blank=True)
views.py
def view_post(request, slug):
...
dablog = Blog.objects.get(slug=slug)
image_list = dablog.images.all()
paginator = Paginator(image_list, 1)
...
In the admin I created one Blog object and two Image objects related to that blog. The code I posted above is only sending the first Image object to paginator and I can't figure out why. I know the rest of my paginator code and the template code work because if i change it to
image_list = Image.objects.all()
I can paginate through both images in the database. Please help this is driving me crazy