问题是我无法在edit_vendor.html中显示记录在比较href plz giude的id之后我有views.py之类的人
def vendor(request,id):
key = request.GET.get('id')
obj = Vendor.objects.get(id = key)
return render_to_response('edit_vendor.html',{'obj': obj},context_instance=RequestContext(request))
模板
<a href ='/vendor/{{vendor.id}}/'> edit </a>
edit_vendor.html
{% for Vendor in obj %}
<tr>
<form action="/update/" method="get">
Vendor Name:<input type ='text' name= 'name' value ={{Vendor.name}}></br>
Address: <input type ='text' name= 'address' value = {{Vendor.address}}></br>
Contact:<input type = 'text' name= 'contact' value = {{Vendor.contact}}></br>
Created Date <input type ='text' name='date' value = {{Vendor.created_date}}></br>
<input type='submit' name='Submit' value='update' />
</form>
</tr>
{% endfor%}