-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use tomselect #421
Use tomselect #421
Conversation
Pull Request Test Coverage Report for Build 6817115265
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Could you use the display name of the user instead of the username as the label field? otherwise we need to change that again with the upcoming keycloak migration as the username will be the UUID from the OIDC sub claim in the future
@@ -22,6 +23,36 @@ | |||
from myhpi.core.widgets import AttachmentSelectWidget | |||
|
|||
|
|||
class UserProfile(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't really like the proxy models and generally prefer substituting the user model as a whole. However, this seems to be a bit tricky for existing projects (https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#changing-to-a-custom-user-model-mid-project).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently blocked as we cannot use first+last name as label
Also created an issue for that: OmenApps/django-tomselect#7 |
we looked at the code of django-tomselect and it turns out that they pass the label field name to their own js code, where it is templated to access the data in some js object. so calling a function/property on the python model is definetly not possible and using a composite label also seems quite hard. I'd vote to abandon the tomselect plan |
Yes, can be closed if and until there is a response to the issue |
There has been a response: OmenApps/django-tomselect#7 (comment) |
Fixes #411 and fixes #336