Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BaseDocument._from_son() deepcopy failed with compiled regex #2438

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

StoneMoe
Copy link

@StoneMoe StoneMoe commented Dec 4, 2020

Fix for issue #2429

@StoneMoe StoneMoe marked this pull request as ready for review December 4, 2020 16:27
mongoengine/fields.py Outdated Show resolved Hide resolved
mongoengine/fields.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@bagerard bagerard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @StoneMoe , thanks for your contribution. It looks great, I only have a minor few comments. Please check the comments and let me know if there are additional questions.

@StoneMoe
Copy link
Author

StoneMoe commented Dec 7, 2020

Hi, thanks for the reviewing, I added more tests and changed approach for this fix based on that.

but there are some question might need more discussion:

  1. deepcopy() won't copy class-level attributes added by __new__, which is instance._fields in this case. which resulting in the test you request to add won't pass in the first place, is this expected or another bug for mongoengine?
  2. deepcopy() works for _fields attribute of the instance returned by _from_son(), but not work for the objects returned from queryset

@StoneMoe StoneMoe closed this Aug 5, 2023
@StoneMoe StoneMoe reopened this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants