-
Notifications
You must be signed in to change notification settings - Fork 66
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
TagTreeModel not compatible with MySQL #1
Comments
Thanks for finding that! There are a couple of options, but the main issue this raises for me is that of slug and path length limits. To fix this issue we could change it to a CharField and make the maximum length of a path 255, or simply remove the |
You're welcome! For now, I've hand-edited my migration to change the field to a I agree that the path field probably doesn't need to be unique, but if it pam On Fri, Oct 16, 2015 at 9:44 AM, Richard Terry notifications@github.com
Pamela McA'Nulty Love Addgene? Follow us: Facebook https://www.facebook.com/addgene | |
Sorry, on mobile, hit comment instead of the text box! Orig comment continues: Nobody should be trying to modify their path directly, and it will be overwitten by Which leads me to the issue of maximum slug/path length. Think that's a different issue, so have opened as #2. Based on my thoughts for #2, I think the best solution would just be to remove uniqueness. You should be fine with your migration fix though, and the upgrade notes will say if you need to do anything special in the future. This also shows the tests need to run against different database types. Thanks again! |
Thanks! All unique fields have a max-length of 191 characters (because MySQL max key length in 767 bytes and utf8mb4 reserves 4 bytes per character, thus 767/4 = 191) If slug and name could both have configurable max-lengths (which should default to 255 if not defined), that would be great. oh, and label should probably max out at the same size as 'name' In our case, our maximum name length right now is 60 chars (with 3 levels in the tree), so 130 more chars should be (famous last words) plenty of headroom. pam |
Thanks for the additional info, and for persevering! I'm travelling at the moment, so I'm afraid I haven't made much progress yet. I'm aiming to have this and other issues fixed in the week starting 9th Nov - will update this issue when there's news. |
FYI: I'm working on a PR for this - and the other charfield length issues. |
Oh great, thanks! I did start adding tests in the 'mysql' branch, but it was too painful to get working using a mobile. Will be back at work next week. |
Note that my PR adds the MAX_LENGTH options and changes path from Text to Char field (since path should usually be the same length as name, this seems to be reasonable) Thus, the MySQL problem is addressed as you suggested by removing the TextField and then by documenting the need for MAX_LENGTH settings dependent on your MySQL character encoding. |
Yes, sorry for the delay - I should have time to work on tagulous properly next week, am hoping to resolve all open issues for the v0.12 release around the end of the week. |
@radiac perfect, thanks a lot! :) 👍 |
See the Django documentation change: django/django@4f83bfa
And the closed ticket: https://code.djangoproject.com/ticket/2495
The text was updated successfully, but these errors were encountered: