Re: [Django] #14497: ModelAdmin.readonly_fields isn't graceful with filefields.

22 views
Skip to first unread message

Django

unread,
May 29, 2011, 1:05:10 PM5/29/11
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn | Owner: adamjforster
Knight <keryn@…> | Status: assigned
Type: New | Component: contrib.admin
feature | Severity: Normal
Milestone: | Keywords: feature admin
Version: 1.2 | readonly filefield
Resolution: | Has patch: 0
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Changes (by adamjforster):

* owner: nobody => adamjforster
* status: new => assigned
* easy: => 0


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

Django

unread,
May 29, 2011, 2:20:29 PM5/29/11
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn | Owner: adamjforster
Knight <keryn@…> | Status: assigned
Type: New | Component: contrib.admin
feature | Severity: Normal
Milestone: | Keywords: feature admin
Version: 1.2 | readonly filefield
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Changes (by adamjforster):

* cc: adam@… (added)
* has_patch: 0 => 1


Comment:

I have added a patch that outputs readonly FileField (and it's subclasses
such as ImageField) values as links to the download file.

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

Django

unread,
Jun 15, 2011, 10:04:55 AM6/15/11
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn | Owner: adamjforster
Knight <keryn@…> | Status: assigned
Type: New | Component: contrib.admin
feature | Severity: Normal
Milestone: | Keywords: feature admin
Version: 1.2 | readonly filefield
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 1
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 1 |
-------------------------------------+-------------------------------------
Changes (by julien):

* needs_tests: 0 => 1


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

Django

unread,
Feb 20, 2012, 7:13:31 AM2/20/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | adamjforster
Type: New feature | Status: assigned
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by adamjforster):

I'm not sure how to test this, can someone else take a look?

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:10>

Django

unread,
Feb 20, 2012, 10:12:43 AM2/20/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | adamjforster
Type: New feature | Status: assigned
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by akaariai):

You might want to check out the admin's Selenium test cases found from
django/contrib/admin/tests.py. Seems like the perfect fit for testing
this.

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:11>

Django

unread,
Mar 9, 2012, 6:49:09 AM3/9/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | adamjforster
Type: New feature | Status: assigned
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by javiersanchez@…):

Let me suggest a small adding. Usually is not necessary to show the
complete path, but just the file name. This is trivial by "import os.path"
and applying "os.path.basename" as below:

return mark_safe(u'<a href="%s">%s</a>'
% (escape(value.url),
os.path.basename(force_unicode(value))))

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:12>

Django

unread,
Mar 12, 2012, 6:50:29 PM3/12/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by paulcollins):

* status: assigned => new
* owner: adamjforster => paulcollins
* needs_tests: 1 => 0


Comment:

@adamjforster I'm grabbing this ticket since you called out for some help
writing tests. Please feel free to grab it back if you'd like. I removed
your check on for value.file, because it causes an IO exception (no such
file) during the unittests. I figured that testing for the actual
existence of the file wasn't really needed to generate the link to the
file.

@akaariai I've added the Selenium tests, but I'm not sure if that's the
fastest way to test that the field is rendering correctly in the admin.
Suggestions?

@javiersanchez I can update the patch for this but that would make this
particular interface inconsistent with the read/write interface. In the
current version the link is rendered the same way, though it's rendered by
different code.

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:13>

Django

unread,
Mar 12, 2012, 9:14:39 PM3/12/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by paulcollins):

After some discussion with Julian I removed the Selenium tests and did
basically the same thing with the django.test.client

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:14>

Django

unread,
Mar 13, 2012, 1:49:49 AM3/13/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by paulcollins):

Updated because julien was getting a unit test failure on his osx machine.
Is there a bug with assertContains(html=True)?
If this passes on his machine then there might be an issue in there. More
when I hear back from julien.

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:15>

Django

unread,
Mar 13, 2012, 5:54:40 AM3/13/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by julien):

* needs_better_patch: 0 => 1


Comment:

Thank you, Paul. I realized the test was failing for me because of the
hardcoded "media/" in the url path. Using the string variable
`STORAGE_URL` fixes that (see patch above).

I've also noticed that the same display logic is used on the changelist
when a file field is in `list_display`. It'd be great to write an extra
test to cover that test. Other than that, the patch looks great!

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:16>

Django

unread,
Mar 13, 2012, 2:31:00 PM3/13/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Design
readonly filefield | decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by paulcollins):

* stage: Accepted => Design decision needed


Comment:

Replying to [comment:16 julien]:

> I've also noticed that the same display logic is used on the changelist
when a file field is in `list_display`.

[[BR]]

Uhoh. So this is something I completely missed. It seems that
display_for_field is implicitly expected to just return a text value, not
an HTML value.
If a read only file field is listed in the `list_display` then in the
admin the link to edit that object vanishes. The HTML ends up looking like
<a href='link to admin page'><a href='link to
file'>filepath/filename</a></a>. Worse, if it's the only thing listed in
`list_display` it leaves the end user no obvious way to go and actually
edit the object.

An icky feeling fix would be to go and put the special case logic for this
in contrib.admin.helpers.AdminReadonlyField.contents which is what's being
called to display it on the modify object page. After some discussion with
julien though, I'm kicking this back to DDN. Maybe at some point the
AdminReadonlyField class will be refactored to allow for this kind of
flexibility.

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:17>

Django

unread,
Mar 18, 2012, 8:01:55 PM3/18/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Design
readonly filefield | decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by thepapermen):

* cc: thepapermen (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:18>

Django

unread,
Mar 29, 2012, 4:55:22 AM3/29/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Design
readonly filefield | decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by anonymous):

+1
this feature would be very helpful

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:19>

Django

unread,
Oct 9, 2012, 3:28:08 AM10/9/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Design
readonly filefield | decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by zout):

+1
Weird it isn't there, please include this in the next minor release

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:20>

Django

unread,
Oct 9, 2012, 4:03:52 AM10/9/12
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Design
readonly filefield | decision needed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by anonymous):

+1!
Really want to have this feature available!

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:21>

Django

unread,
Mar 22, 2013, 3:03:55 PM3/22/13
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* stage: Design decision needed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:22>

Django

unread,
May 27, 2013, 3:55:36 AM5/27/13
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by rm_):

* cc: riccardo.magliocchetti@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:23>

Django

unread,
Sep 11, 2013, 1:48:59 PM9/11/13
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by paulcollins):

@aaugustin
So I see you've marked this as accepted. I can dig back into this issue
again and see if my horrible hack solution would even still apply here.
Assuming it does is that the direction I should move this in?

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:24>

Django

unread,
Sep 11, 2013, 2:33:10 PM9/11/13
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

I marked this ticket as "accepted" when we removed "design decision
needed"; it seemed more appropriate than closing it. But I haven't looked
at the patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:25>

Django

unread,
Jan 20, 2015, 5:16:07 AM1/20/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by synotna):

What needs to happen for this to finally make it into a release?

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:26>

Django

unread,
Jan 20, 2015, 10:04:29 AM1/20/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by timgraham):

Submit a pull request on GitHub and uncheck "Patch needs improvement" so
the ticket appears in the review queue. Then find a friend to review the
patch and mark the ticket as "Ready for checkin".

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:27>

Django

unread,
Feb 3, 2015, 9:26:29 AM2/3/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by rm_):

Opened pull request:
https://github.com/django/django/pull/4040

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:28>

Django

unread,
Feb 3, 2015, 9:26:46 AM2/3/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:29>

Django

unread,
Feb 3, 2015, 1:22:23 PM2/3/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Accepted
readonly filefield |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by collinanderson):

* cc: cmawebsite@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:30>

Django

unread,
Feb 3, 2015, 5:16:05 PM2/3/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: new
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution:
Keywords: feature admin | Triage Stage: Ready for
readonly filefield | checkin

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

* stage: Accepted => Ready for checkin


Comment:

Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:31>

Django

unread,
Feb 4, 2015, 9:05:37 AM2/4/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: closed
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution: fixed

Keywords: feature admin | Triage Stage: Ready for
readonly filefield | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"2be621e44c1b5b68c895383f3e20b1f17ddb447a"]:
{{{
#!CommitTicketReference repository=""
revision="2be621e44c1b5b68c895383f3e20b1f17ddb447a"
Fixed #14497 -- Improved admin widget for "read only" FileFields

Based on patch by Adam J Forster, Paul Collins, and Julien.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:32>

Django

unread,
Feb 4, 2015, 9:07:05 AM2/4/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: closed
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution: fixed
Keywords: feature admin | Triage Stage: Ready for
readonly filefield | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"4957b8a40615a082c9218c7c662fb8fccf46b14f"]:
{{{
#!CommitTicketReference repository=""
revision="4957b8a40615a082c9218c7c662fb8fccf46b14f"
[1.8.x] Fixed #14497 -- Improved admin widget for "read only" FileFields

Based on patch by Adam J Forster, Paul Collins, and Julien.

Backport of 2be621e44c1b5b68c895383f3e20b1f17ddb447a from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:33>

Django

unread,
Feb 11, 2015, 1:01:29 PM2/11/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: closed
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution: fixed
Keywords: feature admin | Triage Stage: Ready for
readonly filefield | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"07cfe1bd822f4108b5029aef1615a17000d0b0dc"]:
{{{
#!CommitTicketReference repository=""
revision="07cfe1bd822f4108b5029aef1615a17000d0b0dc"
Refs #14497 -- Handled empty readonly admin FileFields
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:34>

Django

unread,
Feb 11, 2015, 1:01:41 PM2/11/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: closed
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution: fixed
Keywords: feature admin | Triage Stage: Ready for
readonly filefield | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"343c0875338128dad162d4806fe908fb31404d14"]:
{{{
#!CommitTicketReference repository=""
revision="343c0875338128dad162d4806fe908fb31404d14"
[1.8.x] Refs #14497 -- Handled empty readonly admin FileFields

Backport of 07cfe1bd822f4108b5029aef1615a17000d0b0dc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:35>

Django

unread,
Feb 11, 2015, 1:03:00 PM2/11/15
to django-...@googlegroups.com
#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<keryn@…> | paulcollins
Type: New feature | Status: closed
Component: contrib.admin | Version: 1.2
Severity: Normal | Resolution: fixed
Keywords: feature admin | Triage Stage: Ready for
readonly filefield | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by collinanderson):

I also discovered that this takes precedence over list_display_links, but
I think I like the new behavior.

--
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:36>

Reply all
Reply to author
Forward
0 new messages