On using instence= (class name) <django.db.models.query_utils.DeferredAttribute object at 0x00000256CA7C05E0>
views.py
geting path in output instide of values present in it I am trying but not gating answers please provide me some suggestionsfrom django.shortcuts import render
from django.http import *
from MYapp.models import *
from .form import *
def venue(request):
venue_list = Task.objects.all()
return render(request,'MYapp/venue.html',{'venue_list': venue_list})
def navebar(request):
return render(request,'MYapp/navebar.html')
def db(request,db_id):
venues = Task.objects.get(pk=db_id)
return render(request,'MYapp/db.html',{'venues': venues})
def search(request):
if request.method =="POST":
searched = request.POST.get('searched', False)
Tasks =Task.objects.filter( firstname__contains = searched)
return render(request,'MYapp/search.html',{'searched':searched, 'Tasks':Tasks})
else:
return render(request,'MYapp/search.html',{})
def update(request,db_id):
venues = Task.objects.get(pk=db_id)
form = TaskForm(request.POST or None, instance=Task)
return render(request,'MYapp/update.html',{'venues': venues,'form':form})
assigning a variable instead of class
def update(request,db_id):
venues = Task.objects.get(pk=db_id)
form = TaskForm(request.POST or None, instance=Task)
return render(request,'MYapp/update.html',{'venues':
venues,'form':form})
do this
def update(request,db_id):
venues = Task.objects.get(pk=db_id)
form = TaskForm(request.POST or None, instance=venues )
return render(request,'MYapp/update.html',{'venues':
venues,'form':form})
assigning a variable instead of class
def update(request,db_id):
venues = Task.objects.get(pk=db_id)
form = TaskForm(request.POST or None, instance=Task)
return render(request,'MYapp/update.html',{'venues':
venues,'form':form})
do this
def update(request,db_id):
venues = Task.objects.get(pk=db_id)
form = TaskForm(request.POST or None, instance=venues )
return render(request,'MYapp/update.html',{'venues':
venues,'form':form})