[Django] #25741: Make 'request' available to syndication.Feed methods

22 views
Skip to first unread message

Django

unread,
Nov 12, 2015, 5:30:58 AM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+----------------------------------
Reporter: RamezIssac | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.syndication | Version: 1.8
Severity: Normal | Keywords: syndication, request
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+----------------------------------
Use case : adding an image to feed.
i will to override Feed.item_extra_kwargs() and get my image url, But i
can't make a Full URL as i'm missing the request.host

Proposal:
Add request to Feed class so it's accessible via self.request (as CBV)

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

Django

unread,
Nov 12, 2015, 5:34:51 AM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.syndication | Version: 1.8
Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage:
request | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by RamezIssac):

* needs_better_patch: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* needs_docs: => 0


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

Django

unread,
Nov 12, 2015, 8:05:15 AM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8

Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage:
request | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by alexmorozov):

* owner: nobody => alexmorozov
* status: new => assigned


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

Django

unread,
Nov 12, 2015, 9:50:10 AM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8
Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage: Accepted
request |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


Comment:

Looks like an okay idea at first glance.

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

Django

unread,
Nov 12, 2015, 9:52:54 AM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8

Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage: Accepted
request |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by alexmorozov):

I believe this will require functionality similar to `View.as_view()` to
be thread-safe. Or even sublassing the `Feed` from the generic `View`. But
this apparently will break backwards compatibility.

@timgraham, what do you think about it? Is it worth bothering?

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

Django

unread,
Nov 12, 2015, 10:09:27 AM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8

Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage: Accepted
request |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by RamezIssac):

Either add it to the Feed class in `Feed.__call__()` , or later on in
`Feed.get_feed()`
If that is not convenient for some reason (@alexmorozov care to elaborate
on thread safe part, How this wont be thread safe?! I'm not an expert in
this area)

The next best thing is to send it as a parameter but this road is long,
bumpy and not backward compatible.

--
Ticket URL: <https://code.djangoproject.com/ticket/25741#comment:5>

Django

unread,
Nov 12, 2015, 4:08:56 PM11/12/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8

Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage: Accepted
request |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by RamezIssac):

Replying to [comment:4 alexmorozov]:


> I believe this will require functionality similar to `View.as_view()` to
be thread-safe. Or even sublassing the `Feed` from the generic `View`. But
this apparently will break backwards compatibility.
>

Can we implement `as_view()` code in the `__call__()` behind the scenes
and escape backward-incompatibility ?!

--
Ticket URL: <https://code.djangoproject.com/ticket/25741#comment:6>

Django

unread,
Nov 13, 2015, 1:55:39 AM11/13/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8

Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage: Accepted
request |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by alexmorozov):

@RamezIssac: I surely can implement it either as a `as_view()` addition or
a `__call__()` override. The problem is, AFAIK, Django is very
conservative when it comes to breaking compatibility (it seems to me, the
`__call()__` override will break it too).

So I'd like to get an approvement from core devs before I start, so that
my work won't be ultimately dumped.
I you ask me, I believe we should subclass the `generic.View`.

--
Ticket URL: <https://code.djangoproject.com/ticket/25741#comment:7>

Django

unread,
Nov 19, 2015, 4:04:09 AM11/19/15
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
-------------------------------------+-------------------------------------
Reporter: RamezIssac | Owner:
Type: | alexmorozov
Cleanup/optimization | Status: assigned
Component: contrib.syndication | Version: 1.8

Severity: Normal | Resolution:
Keywords: syndication, | Triage Stage: Accepted
request |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by alexmorozov):

* easy: 1 => 0


Comment:

Clearing the 'Easy pickings' flag, as it is obviously not the case.

--
Ticket URL: <https://code.djangoproject.com/ticket/25741#comment:8>

Django

unread,
Jun 29, 2022, 3:28:48 AM6/29/22
to django-...@googlegroups.com
#25741: Make 'request' available to syndication.Feed methods
--------------------------------------+------------------------------------
Reporter: Ramez Issac | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.syndication | Version: 1.8
Severity: Normal | Resolution:
Keywords: syndication, request | Triage Stage: Accepted

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

* owner: Alex Morozov => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/25741#comment:9>

Reply all
Reply to author
Forward
0 new messages