type object ‘X’ has no attribute ‘objects’ Django

  Django

Email

View.py coding files  answers
def adminmainmenu(request):
if request.method ==’POST’:
new_item_text = request.POST[‘mainmenu_name’]
Mainmenu.objects.create(mainmenu_name=new_item_text)
else:
new_item_text =”
return render(request, ‘admin_super/home/mainmenu.html’, {
‘new_item_text’: new_item_text,
})
Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of