You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code above I modify the first item of the tags field. It is not possible to use -1 in the keyword. So how to modify the last item of a list field by positional argument?
I know it is possible something like below
blog.tags[-1] = "Python"
blog.save()
However, I implemented a custom signal and put it into the modify method for decoupling audit logs. If I use the save method for updates those updates will be missed in the audit logs.
What I need is something like this
blog.modify(**{"set__tags__-1": "Python"})
The text was updated successfully, but these errors were encountered:
I need to update the last item of a list field positional operator something like below
In the code above I modify the first item of the tags field. It is not possible to use -1 in the keyword. So how to modify the last item of a list field by positional argument?
I know it is possible something like below
However, I implemented a custom signal and put it into the
modify
method for decoupling audit logs. If I use thesave
method for updates those updates will be missed in the audit logs.What I need is something like this
The text was updated successfully, but these errors were encountered: