I'm trying to filter through a set of drafts objects in a database using the request.user variable. They are For some reason I get the error listed bellow. How can I fix this bug?
Function:
def posting_draft(request):
user = request.user
user_drafts = Draft.objects.filter(user = user)
drafts = dict()
for d in user_drafts:
drafts[d.title] = d.id
return render_to_response('posting_draft.html', {'STATIC_URL':STATIC_URL, 'draft_l' : drafts})
Error:
int() argument must be a string or a number, not 'SimpleLazyObject'