#26250: Use a single string placeholder syntax for all user facing APIs
--------------------------------------+--------------------
Reporter: jdufresne | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
Some Django APIs use the legacy % style placeholder syntax while others
use the {{{str.format()}}} style syntax.
I think Django should pick one style and use it consistently for all user
facing APIs.
For example:
{{{str.format()}}} syntax
* [https://docs.djangoproject.com/en/1.9/ref/class-based-views/mixins-
editing/#django.views.generic.edit.ModelFormMixin.success_url success_url]
*
[https://docs.djangoproject.com/en/1.9/ref/utils/#django.utils.html.format_html
format_html()]
Legacy % syntax
* [https://docs.djangoproject.com/en/1.9/ref/forms/validation/#raising-
validationerror ValidationError]
* [https://docs.djangoproject.com/en/1.9/topics/db/models/#be-careful-
with-related-name related_name]
As {{{success_url}}} recently moved to {{{str.format()}}}, I'm guessing
this is Django's preferred style?
I'm suggesting Django deprecate its use of the legacy % syntax in favor of
{{{str.format()}}} syntax. I think this would create a greater API
consistency throughout the framework.
[https://groups.google.com/forum/#!topic/django-developers/J9CfWIgrgbY
django-developers discussion]
--
Ticket URL: <https://code.djangoproject.com/ticket/26250>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.bef4634d8b547bfcedf25b8f12f080df%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.