Skip to content
Advertisement

Direct assignment to the forward side of a many-to-many set is prohibited. Use coolbox_id.set() instead. helpme

I am getting this error when i use many to many field help me plsssssss

views.py

JavaScript

I’ve been stuck here for 3 days now. At first I used it as a CharField so I could add it, but when I added another ID it couldn’t add it. It says there is a problem in this part ship_id_max = shipping.objects.aggregate(Max(‘shipping_id’))[‘ship_id__max’]

models.py

JavaScript

enter image description here enter image description here

HTML

JavaScript

Help me plsssssssssss

Advertisement

Answer

You need to pass a List of objects of not a single object at save

you can do like this …

JavaScript

CODE

https://drive.google.com/file/d/18v_BgTLSmMLhfNCDojhYlTeqkfUsASqt/view?usp=share_link

OUTPUT

after downloading Animatoin.gif file open it in Chrome Browser it’s the full video of working with your project

https://drive.google.com/file/d/1klxwCUb47UI2NimCnSvrqkpc2SB0691S/view?usp=share_link

Advertisement