[Answer]-Appending foreign key reference in django json response

1👍

def relation(request, pk):
    item = get_object_or_404(Table1, pk=pk)
    context= {'content': item}
    return render(request, 'table1/relation.html', context)

urlpatterns = patterns('',
    url(r'^table1/(?P<pk>\d+)/$', relation, name='relation'),
)

Your problem seems to be that none of your python was valid.

Leave a comment