* ui_ux: => 0
* easy: => 0
* stage: Design decision needed => Accepted
Comment:
It should be possible to accept either a string or a list of string, and
to validate that there's only one enclosure for RSS feeds.
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by unaizalakain):
Replying to [comment:7 aaugustin]:
> It should be possible to accept either a string or a list of string, and
to validate that there's only one enclosure for RSS feeds.
Currently `Feed` builds the `Enclosure` from `item_enclosure_url`,
`item_enclosure_length` and `item_enclosure_mime_type`. Accepting an
optional list for one of them would mean accepting optional lists for the
three of them and that would become quite a strange and cumbersome API.
Instead, I propose creating a `item_enclosures` attr/func (following the
way all the rest are gotten) which, by default, returns a list with a
single `Enclosure` in it. That enclosure would be built using the url,
length and mime_type gotten from the corresponding attrs.
RSS feeds could then validate that `item_enclosures` is no longer than 1.
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:8>
* keywords: => multiple, enclosures, atom, feed
* cc: unai@… (added)
* has_patch: 0 => 1
* version: 1.1 => master
* owner: jasonkotenko => unaizalakain
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:9>
Comment (by unaizalakain):
Could something along these lines be enough?
https://github.com/unaizalakain/django/commit/9acc50df64408d4023378ae4259fa1069b215ab2
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:10>
Comment (by unaizalakain):
I updated the commit with the proposed changes and opened a PR:
https://github.com/django/django/pull/5200
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:11>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:12>
* needs_better_patch: 1 => 0
* needs_docs: 1 => 0
Comment:
Updated PR with docs.
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:13>
* needs_tests: 1 => 0
Comment:
Basic tests added, PR updated, ready for review!
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:14>
* needs_better_patch: 0 => 1
Comment:
I left comments for improvement on the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:15>
* needs_better_patch: 1 => 0
Comment:
PR updated!
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:16>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:17>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"aac2a2d2ae2486342058db0c72ed7ba2c7c8eb1e" aac2a2d]:
{{{
#!CommitTicketReference repository=""
revision="aac2a2d2ae2486342058db0c72ed7ba2c7c8eb1e"
Fixed #13110 -- Added support for multiple enclosures in Atom feeds.
The ``item_enclosures`` hook returns a list of ``Enclosure`` objects which
is
then used by the feed builder. If the feed is a RSS feed, an exception is
raised as RSS feeds don't allow multiple enclosures per feed item.
The ``item_enclosures`` hook defaults to an empty list or, if the
``item_enclosure_url`` hook is defined, to a list with a single
``Enclosure``
built from the ``item_enclosure_url``, ``item_enclosure_length``, and
``item_enclosure_mime_type`` hooks.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:18>
* status: closed => new
* keywords: multiple, enclosures, atom, feed => multiple, enclosures,
atom, feed 1.9
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted
Comment:
Reopening per comments on the commit.
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:19>
* has_patch: 0 => 1
Comment:
Sorry about that…
New PR: https://github.com/django/django/pull/5315
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:20>
Comment (by Unai Zalakain <unai@…>):
In [changeset:"a4b80e242162a7d6ac2337a2a621a82027c549b7" a4b80e24]:
{{{
#!CommitTicketReference repository=""
revision="a4b80e242162a7d6ac2337a2a621a82027c549b7"
Refs #13110 -- Fixed mistakes in the new multiple enclosure feed tests
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:21>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:22>
Comment (by Tim Graham <timograham@…>):
In [changeset:"2ec23a3d41be2ba5df9f46b17e0a05eb1b051c41" 2ec23a3d]:
{{{
#!CommitTicketReference repository=""
revision="2ec23a3d41be2ba5df9f46b17e0a05eb1b051c41"
Refs #13110 -- Fixed typo in Feed class reference.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:23>
Comment (by Tim Graham <timograham@…>):
In [changeset:"54295a95d9b34dadb17054b88d43b2b769ccc0f3" 54295a95]:
{{{
#!CommitTicketReference repository=""
revision="54295a95d9b34dadb17054b88d43b2b769ccc0f3"
[1.9.x] Refs #13110 -- Fixed typo in Feed class reference.
Backport of 2ec23a3d41be2ba5df9f46b17e0a05eb1b051c41 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:24>
Comment (by Tim Graham <timograham@…>):
In [changeset:"75cf9b5ac031feb8f94271c9906157c921a14520" 75cf9b5a]:
{{{
#!CommitTicketReference repository=""
revision="75cf9b5ac031feb8f94271c9906157c921a14520"
Refs #13110 -- Removed SyndicationFeed.add_item()'s enclosure argument.
Per deprecation timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/13110#comment:25>