[Django] #28984: Various shortcuts

2 views
Skip to first unread message

Django

unread,
Jan 3, 2018, 7:13:41 AM1/3/18
to django-...@googlegroups.com
#28984: Various shortcuts
------------------------------------------------+------------------------
Reporter: Дилян Палаузов | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------


--
Ticket URL: <https://code.djangoproject.com/ticket/28984>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 3, 2018, 7:14:26 AM1/3/18
to django-...@googlegroups.com
#28984: Various shortcuts
-------------------------------------+-------------------------------------

Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Дилян Палаузов):

* Attachment "various_shortcuts.patch" added.

Django

unread,
Jan 3, 2018, 1:04:34 PM1/3/18
to django-...@googlegroups.com
#28984: Various shortcuts
-------------------------------------+-------------------------------------

Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Core (Other)
* stage: Unreviewed => Ready for checkin


Comment:

[https://github.com/django/django/pull/9532 PR]

The change in django/contrib/admin/models.py isn't included because
besides capitalizing the first character of the string, `capitalize()`
also lower cases the rest of the characters which isn't desired.

--
Ticket URL: <https://code.djangoproject.com/ticket/28984#comment:1>

Django

unread,
Jan 3, 2018, 1:11:43 PM1/3/18
to django-...@googlegroups.com
#28984: Assorted code simplifications
-------------------------------------+-------------------------------------

Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/28984#comment:2>

Django

unread,
Jan 3, 2018, 1:24:17 PM1/3/18
to django-...@googlegroups.com
#28984: Assorted code simplifications
-------------------------------------+-------------------------------------
Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"acc8dd4142ec81def9a73507120c0262ba6b1264" acc8dd4]:
{{{
#!CommitTicketReference repository=""
revision="acc8dd4142ec81def9a73507120c0262ba6b1264"
Fixed #28984 -- Made assorted code simplifications.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28984#comment:3>

Django

unread,
Jan 3, 2018, 1:30:46 PM1/3/18
to django-...@googlegroups.com
#28984: Assorted code simplifications
-------------------------------------+-------------------------------------
Reporter: Дилян Палаузов | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jon Dufresne):

> The change in django/contrib/admin/models.py isn't included because
besides capitalizing the first character of the string, capitalize() also
lower cases the rest of the characters which isn't desired.

`capfirst()` may be a suitable alternative:

https://github.com/django/django/blob/2.0.1/django/utils/text.py#L15-L17

Found the pattern repeated in the folowing:

{{{
./django/utils/lorem_ipsum.py:68: return '%s%s%s' % (s[0].upper(),
s[1:], random.choice('?.'))
./django/template/defaultfilters.py:75: return value and
value[0].upper() + value[1:]
./django/contrib/admin/models.py:125: change_message = '
'.join(msg[0].upper() + msg[1:] for msg in messages)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28984#comment:4>

Reply all
Reply to author
Forward
0 new messages