Skip to content
Advertisement

Tag: django-rest-framework

How to serialize first photo in album? Django

How to serialize first photo in album if photo connected by using FK with model Gallery. I need first photo for gallery cover in galley list. My models: Anyone have any ideas? May be I need suchlike request Gallery.objects.get(id=id).photos.first() but i not sure is it correct. Answer get returns only one object. filter returns multiple objects. You can access the

Advertisement