QuerySet, Object has no attribute id - Django
The reason why you are getting the error is because at
is a QuerySet
ie: a list. You can do something like at[0].id
or use get
instead of filter
to get the at
object.
Hope it helps!
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)