Hi all,
I have a simple model whichs acts as custom many-to-many association table with additional data.
```
class NetworkLinkAssociation(models.Model):
"""
We use our own many-to-many association table, because we want to keep
track which links are added, and which links are deleted/disabled in
comparison to the parent network.
"""
network = models.ForeignKey('Network', related_name='links_assoc',
on_delete=models.CASCADE)
link = models.ForeignKey('Link', related_name='networks_assoc',
on_delete=models.CASCADE)
type = enum.EnumField(AssociationType, default=AssociationType.UNCHANGED,
null=True)
class Meta:
unique_together = ('network', 'link')
@property
def link_disabled(self):
return self.type == AssociationType.REMOVED
```
When trying to simply create a new object django raises an error:
```
link_assoc = NetworkLinkAssociation()
link_assoc.link = link
link_assoc.network = network
link_assoc.save()
```
"ValueError: Cannot force an update in save() with no primary key.".
I'm 100% sure the `link` and `network` objects exist, so what else could the problem be? This used to work fine Django 1.9.
Possibly related bug on Github:
https://github.com/jpwatts/django-positions/issues/49Thanks in advance,
Lucas