Opened 2 years ago
Closed 2 years ago
#33972 closed Bug (worksforme)
Copying model instances of many-to-many field doesn't apply changes to database
Reported by: | Eido Askayo | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 4.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In section Copying model instances, the following code is shown:
entry = Entry.objects.all()[0] # some previous entry old_authors = entry.authors.all() entry.pk = None entry._state.adding = True entry.save() entry.authors.set(old_authors)
entry.save()
applies changes to database, but entry.authors.set(old_authors)
doesn't.
Note:
See TracTickets
for help on using tickets.
This passing test shows it does:
You probably need to get some help from support channels.