My question is can I use a function view to pass in a model inside my template to be iterated through. This is how my model looks like:
class Listing(models.Model):
user = models.ForeignKey( User, on_delete=models.CASCADE)
itempicture = models.ImageField(upload_to="images",blank=False)
title = models.CharField(max_length=50)
about = models.CharField(max_length=500)
published_date = models.DateTimeField(blank=True, null=True)
How can I write a function based view to pass in my database just like a class based (list view)?