django-translated-fields

Django model field contain strange attribute _(“private”)

笑着哭i 提交于 2020-11-29 10:26:26
问题 Currently I have been learning Django and while reading, I have come across the below code block which I don't understand. private = models.BooleanField( _('private'), default=False, help_text=_('theme is available ONLY for the site.'), ) The above line of code contains _('private') and I am not able to understand what it does. I know about using _ for translation-related stuff. Why attribute name not declared for _("private") ? I have tried to find the answer online but have been unable.

Django model field contain strange attribute _(“private”)

佐手、 提交于 2020-11-29 10:25:52
问题 Currently I have been learning Django and while reading, I have come across the below code block which I don't understand. private = models.BooleanField( _('private'), default=False, help_text=_('theme is available ONLY for the site.'), ) The above line of code contains _('private') and I am not able to understand what it does. I know about using _ for translation-related stuff. Why attribute name not declared for _("private") ? I have tried to find the answer online but have been unable.