I\'m trying to fetch the id of certain object in django but I keep getting the following error Exception Value: QuerySet; Object has no attribute id. my function in views.py
In most cases you do not want to handle not existing objects like that. Instead of
ad[0].id
use
get_object_or_404(AttachedInfo, attachedMarker=m.id, title=title)
It is the recommended Django shortcut for that.