myyang / django-pb-model

Protobuf mixin for django model
Other
112 stars 22 forks source link

fix: avoid double save without m2m #33

Closed akionakamura closed 2 years ago

akionakamura commented 2 years ago

Relates to Issue: https://github.com/myyang/django-pb-model/issues/32

I investigated a bit, and for the m2m relation, it really does look like we must double save so we can have the proper cross-reference IDs.

However, I'm adding a simple if clause to only do that, in case there is a m2m relation. That should not be needed on simple models.

myyang commented 2 years ago

I'll update pypi with new minor version.