[Django] #35261: Media Path as Objects - Documentation fix and usage example

26 views
Skip to first unread message

Django

unread,
Feb 29, 2024, 4:39:18 AM2/29/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro | Owner: nobody
de Souza |
Type: | Status: new
Uncategorized |
Component: | Version: 4.1
Documentation | Keywords: Documentation,
Severity: Normal | Media
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
[Related conversation on forum](https://forum.djangoproject.com/t/media-
path-as-objects/28470)

Issue: The documentation for [Media Path as
Objects](https://docs.djangoproject.com/en/4.1/topics/forms/media/#paths-
as-objects) uses an incorrect attribute (`rel`) on a `script` tag, source:
[HTML attribute: rel - HTML: HyperText Markup Language |
MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
Quoted from the source:

`The rel attribute defines the relationship between a linked resource and
the current document. Valid on <link>, <a>, <area>, and <form>, the
supported values depend on the element on which the attribute is found.`

Another thing is that the example given for the usage of this new feature
added on 4.1 is not really that useful. The `JSPath` class in the example
is just a hardcoded script tag that illustrates how to use the `__str__`
method to render the tag.

I believe that adding a more useful example would add more "bright" to the
value that this feature has providen: adding flexibility. Some usage
examples of this new feature has been added to the conversation on the
forum.

I would be happy to work on this patch/fix.
--
Ticket URL: <https://code.djangoproject.com/ticket/35261>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 29, 2024, 4:43:27 AM2/29/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: Documentation, | Triage Stage:
Media | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Leandro de Souza:

Old description:

> [Related conversation on forum](https://forum.djangoproject.com/t/media-
> path-as-objects/28470)
>
> Issue: The documentation for [Media Path as
> Objects](https://docs.djangoproject.com/en/4.1/topics/forms/media/#paths-
> as-objects) uses an incorrect attribute (`rel`) on a `script` tag,
> source: [HTML attribute: rel - HTML: HyperText Markup Language |
> MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
> Quoted from the source:
>
> `The rel attribute defines the relationship between a linked resource and
> the current document. Valid on <link>, <a>, <area>, and <form>, the
> supported values depend on the element on which the attribute is found.`
>
> Another thing is that the example given for the usage of this new feature
> added on 4.1 is not really that useful. The `JSPath` class in the example
> is just a hardcoded script tag that illustrates how to use the `__str__`
> method to render the tag.
>
> I believe that adding a more useful example would add more "bright" to
> the value that this feature has providen: adding flexibility. Some usage
> examples of this new feature has been added to the conversation on the
> forum.
>
> I would be happy to work on this patch/fix.

New description:

Related conversation on forum: [https://forum.djangoproject.com/t/media-
path-as-objects/28470]

Issue: The documentation for Media Path as Objects
[https://docs.djangoproject.com/en/4.1/topics/forms/media/#paths-as-
objects] uses an incorrect attribute (`rel`) on a `script` tag, source:
HTML attribute: rel - HTML: HyperText Markup Language | MDN
[https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel]. Quoted
from the source:

`The rel attribute defines the relationship between a linked resource and
the current document. Valid on <link>, <a>, <area>, and <form>, the
supported values depend on the element on which the attribute is found.`

Another thing is that the example given for the usage of this new feature
added on 4.1 is not really that useful. The `JSPath` class in the example
is just a hardcoded script tag that illustrates how to use the `__str__`
method to render the tag.

I believe that adding a more useful example would add more "bright" to the
value that this feature has providen: adding flexibility. Some usage
examples of this new feature has been added to the conversation on the
forum.

I would be happy to work on this patch/fix.

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

Django

unread,
Feb 29, 2024, 7:45:14 AM2/29/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
--------------------------------------+------------------------------------
Reporter: Leandro de Souza | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: Documentation, Media | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted
* type: Uncategorized => Bug

Comment:

As per the discussion, I’ll accept to fix the error with the `rel` tag.

I’d suggest doing that in an initial commit.

Then, I think there’s some review to be done to judge the “better example”
right. (Enough but not too much)
--
Ticket URL: <https://code.djangoproject.com/ticket/35261#comment:2>

Django

unread,
Feb 29, 2024, 8:50:37 AM2/29/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: Leandro
| de Souza
Type: Bug | Status: assigned
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: Documentation, | Triage Stage: Accepted
Media |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Leandro de Souza):

* owner: nobody => Leandro de Souza
* status: new => assigned

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

Django

unread,
Feb 29, 2024, 8:52:59 AM2/29/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: Leandro
| de Souza
Type: Bug | Status: assigned
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: Documentation, | Triage Stage: Accepted
Media |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Leandro de Souza):

After reading the docs on how to submit a patch, i haven't figured it out
from which branch should my patch be based. Should it be from the django's
"main" branch?
--
Ticket URL: <https://code.djangoproject.com/ticket/35261#comment:4>

Django

unread,
Mar 1, 2024, 10:19:25 AM3/1/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: Leandro
| de Souza
Type: Bug | Status: assigned
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: Documentation, | Triage Stage: Accepted
Media |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Leandro de Souza):

* has_patch: 0 => 1

Comment:

Opened the pull request [https://github.com/django/django/pull/17926] for
the initial patch.
Waiting for new directives about the more "detailed" examples mentioned.
Cheers and thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/35261#comment:5>

Django

unread,
Mar 4, 2024, 7:45:39 AM3/4/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: Leandro
| de Souza
Type: Bug | Status: assigned
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: Documentation, | Triage Stage: Ready for
Media | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin

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

Django

unread,
Mar 4, 2024, 12:59:59 PM3/4/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: Leandro
| de Souza
Type: Bug | Status: closed
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: Documentation, | Triage Stage: Ready for
Media | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

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

Comment:

In [changeset:"368a8a3a83885a13776a530920f0317a40e7989d" 368a8a3]:
{{{#!CommitTicketReference repository=""
revision="368a8a3a83885a13776a530920f0317a40e7989d"
Fixed #35261 -- Corrected Media JS example of object-based paths in docs.

`rel` attribute is not valid on `<link>` tags.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35261#comment:7>

Django

unread,
Mar 4, 2024, 1:00:55 PM3/4/24
to django-...@googlegroups.com
#35261: Media Path as Objects - Documentation fix and usage example
-------------------------------------+-------------------------------------
Reporter: Leandro de Souza | Owner: Leandro
| de Souza
Type: Bug | Status: closed
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: Documentation, | Triage Stage: Ready for
Media | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"17855bf578da756b1804542133dd1e514c15a1f3" 17855bf]:
{{{#!CommitTicketReference repository=""
revision="17855bf578da756b1804542133dd1e514c15a1f3"
[5.0.x] Fixed #35261 -- Corrected Media JS example of object-based paths
in docs.

`rel` attribute is not valid on `<link>` tags.
Backport of 368a8a3a83885a13776a530920f0317a40e7989d from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35261#comment:8>
Reply all
Reply to author
Forward
0 new messages