Hi Florian,

Il 22/11/2015 21:14, Florian Demmer ha scritto:
Hi guys,

i am confused/surprised by this ticket and already merged feature. it took me a
while to find out what was happening in my admin:

https://code.djangoproject.com/ticket/14497

- it was merged into 1.8, right? the ticket says 1.2.

That was set at the time of filing the issue supposedly
It's pretty clear it has been applied to master and then backported:
https://code.djangoproject.com/ticket/14497#comment:32

- there was no documentation in the patch, no info about it in the release notes
or did i overlook something?

If it's not in the release notes i think this has been considered as a minor 
change

- as far as i can see, the patch was not changed after paulcollins' remark on
the list_display-behaviour, so it was merged as is/was

Yep, it looks like i completely missed that

- it has great potential to break one's admin and requires some digging in the
source to find out why

indeed, fortunately using a file field as first element is not so common

So, what this new feature does is: it adds a link to the file of the `FileField`
in the change_list and read-only version of the form-field in the change_view.
In the change_list that link is also added, when the `FileField` is the first
column or it is in `list_display_links`.

The result is two a-tags in the resulting html, where the link to the file takes
precedence. There is no way to go to the change_view or pick the row in a raw_id
popup anymore. And there is no way to disable the feature.

Both change_list and change_view (for read-only fields) use
`display_for_field()`, that's why both are affected by the change. That might
not have been on purpose...

I usually don't break software on purpose :)

Imho, the automatically added link to the file should *not* have precedence over
`list_display_links` and definitely should *not* break the automatically added
link to the change_view, when the `FileField` happens to be first in 
`list_display`.

What do you think?

Since you seem to care about this, any chance to open a pull request? The pull request should contain updated tests to verify that the double <a> link is fixed please. If not i'll give a try of fixing it later this week.

thanks

--
Riccardo Magliocchetti
@rmistaken

http://menodizero.it

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/5652260E.1090608%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to