Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cascade_save does not save new referenced document #1236
Comments
|
I have the same problem. |
|
Hi. Any news on this ? It seems like the bug is still there. |
|
Get the same behaviour here with MongoEngine 0.11.0.
|
|
I have the same problem reported here, save(cascade=True) doesn't work and thus saving the parent document throws a ValidationError. |
|
Same issue here. |
|
+1 bumping this, it would be great to be able to save new embedded documents as references without having to dig into the substructure of the parent document to save all the new objects. |
|
+1 bumping this. How is this still open after four years? |
|
+1 |
|
+1 once again. Having to override the def save(self, *args, **kwargs):
for ref in self.refs.values():
ref.save()
return super().save(*args, **kwargs) |
|
+1 |
When saving a document with a
ReferenceFieldholding a new object, I get an error:I naively expected
cascade=Trueto automatically save the new document, while apparently it only automatically saves changes to existing documents.Is this something that could be changed or is it meant to be for good reasons?
Example:
I'd like this not to throw
ValidationErrorbut to saveu1in cascade.The text was updated successfully, but these errors were encountered: