-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[fix] SortedListField: update whole list if order is changed #978
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
Conversation
|
|
|
I would also love if you guys apply this fix to |
|
+1 |
|
I seriously doubt we will release another 0.8.x version... many things have been fixed with 0.9, even if some breaking changes were introduced. Which issue would prevent you from using 0.9+ ? |
|
Else, very good job ! You may add your name to the contributors and a line in the changelog. Good to merge for me 👍 |
|
@MRigal the only big problem for me is {name: 'Bob', age: 22}Model: class User(Document):
name = StringField()I get So |
|
This won't stay a problem much longer for you, as we are gonna merge #957 which will re-allow old behaviour for the next version |
|
@MRigal cool! I also want to check updating SortedListField of StringFields or IntFields and include here if something needs to be fixed. |
|
|
|
@MRigal SortedListField for primitives gets handled perfectly. Feel free to merge |
|
Strange failure, I've restarted the problematic job |
|
@MRigal Yeah, I've changed only docs. Seems to be good now |
In case we have document with
SortedListFieldin DB and we want to update order by changingorderingfieldSortedListField.to_mongoreturns correct sorted listBut
BaseDocument._deltagenerates wrongset_datatrying to update only specific fields at specific indexes without realizing that list order is changed and those indexes are incorrectTo fix that we make
BaseDocument._get_changed_fieldsaware ofSortedListFieldwith_orderingbehavior.Related test cases are added
Cheers