Hello,

i have a extend User Model like this:

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)        
telefon = encrypt(models.CharField(max_length=70,default="",null=True))



and a class with documents incl. fotos:

class Document(models.Model):
profile_link = models.ForeignKey(Profile, blank=True,null=True, 
on_delete=models.SET_NULL,related_name="document_profile_link")

Now in html template i want that all fotos per profile is show:

{% for Profile in Profiles %}
{% for Document in Documents %}
{% if '.png' in document.file or '.jpg' in document.file  %}
    <td> <img src="{{document.file}}" alt="" height="42" > </td>
{% else %}
    <td>No Image</td>
{% endif %}
{% endfor %}


{% endfor %}

Where can i link for Documents loop to Profile?

Regards


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d752379-92ef-4dfe-b17a-961e0cc58b3f%40googlegroups.com.

Reply via email to