-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
tree_ordering: returns int instead of string values after upgrade from 0.16.1 to 0.18 #65
Comments
Hi @nuarhu Thanks! I'm sorry to hear that recent changes which were added to support more ways of ordering siblings broke your code. The |
Thank you for the speedy answer! Ok, I'll remove the usage then. Thanks for your suggestion of denormalizing the label. I just need to think through what is necessary to keep them up to date. |
Just to mention that @nuarhu is not alone being hit by this change, i was heavily using those 2 fields, so, for now, sticking to 0.16 is my only workaround in a reasonable amount of work. |
Yeah, I hear you. By the way, I think the additional functionality provided by recent changes is a good thing, but I can see that it's breaking other use cases. Would it help if there was a way to include additional fields in the recursive CTE? I don't know how something like this could be implemented on sqlite3 and mysql/mariadb without the same ugly hacks as the current |
Here's a terrible hack which works for a very basic test case on PostgreSQL: Something like this could work, but it would obviously have to be cleaned up a lot. |
@matthiask that was exactly what i planned to do (i'm on pg-only projects), and it is really a great addition when you need to retrieve other fields (permissions, status, ...) for all ancestors, without having to loop with get_ancestors. You did it faster... thanks a lot 👏 ❤️ |
@jmbarbier Great! It's not finished yet btw, so if you want to contribute there's still work to do :-) I won't be able to finish this in the next ~10 days. |
I've committed the |
Check this out: django-tree-queries/tests/testapp/test_queries.py Lines 928 to 952 in 42e797c
|
Hi,
after upgrading to 0.18 my tests are failing at the usages of
tree_ordering
. I tried different versions, and the failures do not show up with 0.16.1 but with 0.17 and 0.18.Model:
full_label
returns a translation label likeglobal.button.save
whereglobal
,button
, andsave
are 3 instances ofTranslationKey
.This code is running fine up until 0.16.1 but fails after upgrading to 0.17 when running as part of a Django test - which means that the DB is setup with migrations from scratch before each test. In this case, my tests run on SQLite (the actual app runs on Postgres).
I have not found any release notes that indicate I need to change something (which would be completely fine), and I have not found any issues in this github repo about this. Am I the only one facing this issue?
Thanks for this library!
The text was updated successfully, but these errors were encountered: