-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Implemented Verbose Name Translation for TokenProxy #8713
Conversation
@@ -51,4 +51,5 @@ def pk(self): | |||
class Meta: | |||
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS | |||
abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS | |||
verbose_name = "token" | |||
verbose_name = _("Token") |
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.
just to make sure, adding this two lines with modified values, is there any possible missing migrations?
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.
As far as I understand it, no. Migrations only accept hard coded values, but since this is not one, a migration would not make sense. It must be created when the language is set.
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.
the TokenProxy model is inheriting from https://github.com/encode/django-rest-framework/blob/master/rest_framework/authtoken/models.py#L27 but still not showing it properly, right?
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.
from the migrations history https://github.com/encode/django-rest-framework/tree/master/rest_framework/authtoken/migrations it would be safer to check locally if new migrations are generated with this two attribute changes in meta. if not it is OK. but if so, we must have to ship it with the package :)
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.
thanks for adding the missing auto migration
@@ -51,4 +51,5 @@ def pk(self): | |||
class Meta: | |||
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS | |||
abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS | |||
verbose_name = "token" | |||
verbose_name = _("Token") |
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.
from the migrations history https://github.com/encode/django-rest-framework/tree/master/rest_framework/authtoken/migrations it would be safer to check locally if new migrations are generated with this two attribute changes in meta. if not it is OK. but if so, we must have to ship it with the package :)
90e276b
to
be94cd6
Compare
@auvipy Can you help me out there for a second ? Do you know what went wrong with the Python 3.9 CI check? Can't quite figure it out |
that is not related to this PR from what I have seen. |
Added translation for verbose name of TokenProxy
Fixes Issue #8537