If I'm following correctly and you want to access author profile photos
from querysets of Post objects: if you add related_name=‘profile’ to the
user field in the Profile model then you can add a method to the Post model:
def author_profile_photo(self):
return self.author.profile.photo
and
On Thursday 22 December 2016 17:45:56 skerdi wrote:
> That get_photo func, I'm not using it. It tried to do something and I
> forgot to delete it.
Try this on the Profile model:
*def get_photo_url(*self, user, when_following*=True**):if
*when_following*:try:if
*self.follo
That get_photo func, I'm not using it. It tried to do something and I
forgot to delete it.
About screenshotting the code, I thought that it was more clarifying.
class ProfileManager(models.Manager):
use_for_related_fields = True
def all(self):
qs = self.get_queryset().all()
Hi,
not sure why you're screenshotting code instead of copying it...makes it
harder to point you at the mistake.
On Wednesday 21 December 2016 14:33:58 skerdi wrote:
> *In a post list I've shown only the users posts that I follow but I'm
> not able to display their photo. *
in Profile.get_phot
4 matches
Mail list logo