[Django] #35537: Use a namedtuple for email attachments and alternatives

19 views
Skip to first unread message

Django

unread,
Jun 19, 2024, 10:27:24 AM6/19/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah | Owner: Jake Howard
Boyce |
Type: | Status: assigned
Cleanup/optimization |
Component: Core | Version: dev
(Mail) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Ticket to track: https://github.com/django/django/pull/18261

This makes unpacking the specific indexes more descriptive, whilst
avoiding breaking any existing uses (since the field order hasn't
changed).
{{{
email.alternatives[0][0] # before
email.alternatives[0].content #after
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35537>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 19, 2024, 10:28:40 AM6/19/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Jake
Type: | Howard
Cleanup/optimization | Status: assigned
Component: Core (Mail) | Version: dev
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 Sarah Boyce):

* has_patch: 0 => 1

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

Django

unread,
Jun 19, 2024, 11:17:46 AM6/19/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Jake
Type: | Howard
Cleanup/optimization | Status: assigned
Component: Core (Mail) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jake Howard):

* stage: Unreviewed => Accepted

Comment:

Yes, I definitely accept this ticket for a PR I created! 😝
--
Ticket URL: <https://code.djangoproject.com/ticket/35537#comment:2>

Django

unread,
Jun 19, 2024, 12:04:37 PM6/19/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Jake
Type: | Howard
Cleanup/optimization | Status: assigned
Component: Core (Mail) | Version: dev
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 Sarah Boyce):

* stage: Accepted => Ready for checkin

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

Django

unread,
Jun 20, 2024, 3:43:49 AM6/20/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Jake
Type: | Howard
Cleanup/optimization | Status: closed
Component: Core (Mail) | Version: dev
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 Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"aba0e541caaa086f183197eaaca0ac20a730bbe4" aba0e54]:
{{{#!CommitTicketReference repository=""
revision="aba0e541caaa086f183197eaaca0ac20a730bbe4"
Fixed #35537 -- Changed EmailMessage.attachments and
EmailMultiAlternatives.alternatives to use namedtuples.

This makes it more descriptive to pull out the named fields.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35537#comment:4>

Django

unread,
Aug 5, 2024, 3:21:54 AM8/5/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Jake
Type: | Howard
Cleanup/optimization | Status: closed
Component: Core (Mail) | Version: dev
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 Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"d5bebc1c26d4c0ec9eaa057aefc5b38649c0ba3b" d5bebc1]:
{{{#!CommitTicketReference repository=""
revision="d5bebc1c26d4c0ec9eaa057aefc5b38649c0ba3b"
Refs #35537 -- Improved documentation and test coverage for email
attachments and alternatives.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35537#comment:5>

Django

unread,
Aug 14, 2024, 4:00:15 AM8/14/24
to django-...@googlegroups.com
#35537: Use a namedtuple for email attachments and alternatives
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Jake
Type: | Howard
Cleanup/optimization | Status: closed
Component: Core (Mail) | Version: dev
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 Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"43cdfa8b20e567a801b7d0a09ec67ddd062d5ea4" 43cdfa8b]:
{{{#!CommitTicketReference repository=""
revision="43cdfa8b20e567a801b7d0a09ec67ddd062d5ea4"
Refs #35537 -- Clarified release notes for email attachments and
alternatives changes.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35537#comment:6>
Reply all
Reply to author
Forward
0 new messages