QuerySet, Object has no attribute id – Django

this line of code

at = AttachedInfo.objects.filter(attachedMarker=m.id, title=title)

returns a queryset

and you are trying to access a field of it (that does not exist).

what you probably need is

at = AttachedInfo.objects.get(attachedMarker=m.id, title=title)

Leave a Comment