hello

if i want to create a query in django with to take all images and preview that 
list in html like easy work.

but if want in html page preview only the personal images where login user what 
changes i need in my code ?

model.py
class MyModel(models.Model):
    user = models.ForeignKey(User, unique=True)
    photo = models.ImageField(upload_to='images')


views.py

class BasicUploadView(request):
        photos_list = Photo.objects.all()
        return render(request, 'photos/basic_upload/index.html', {'photos': 
photos_list})


html page :

  {% for photo in photos %}
        <tr>
          <td><a href="{{ photo.file.url }}">{{ photo.file.name }}</a></td>
        </tr>
      {% endfor %}
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to