Hi Everybody,
Kindly help me out.
My views.py file is:
def video_detail_view(request):
obj = str(Video.objects.get(id=id))
print(obj)
context = {
"object": obj
}
return render(request, "deploy/list_view.html", context)
def video_list_view(request):
queryset = Video.objects.all()
print(queryset)
for obj in queryset:
print(obj.Video_Description, obj.videofile)
context = {
"object_list": queryset
}
return render(request, "deploy/detail_view.html", context)
The models.py file is:
class Video(models.Model):
Video_Description= models.CharField(max_length=500)
videofile= models.FileField(upload_to='videos/', null=True, verbose_name="")
def __str__(self):
return self.Video_Description + ": " + str(self.videofile)
The error I am getting is:
int() argument must be a string, a bytes-like object or a number not 'builtin_function_or_method'.
The error is in views.py file in obj = str(Video.objects.get(id=id)).
Kindly help me out.
Thank you
Best
Aakash