Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - raw_id_fields title not refreshing

Tags:

django

I am currently having an issue when using the raw_id_field within admin.py in my Django project.

My site's admin area has a number of image upload fields for various different model pages which are all ForeignKey fields to an Image model where all images for the site are stored. As the site will eventually be dealing with a large quantity of images (100s, maybe 1000s) the default select box would be unusable.

I created various admin.ModelAdmin classes e.g

class InfoSlideAdmin(admin.ModelAdmin):
    raw_id_fields=('image',) 

These change the image selector within my Edit pages from a Select Box to a Raw ID Field.

However when I select a different image using this control although the ID of the new image is shown the title from the previous image still displays.

Any ideas?

like image 504
James Howell Avatar asked Nov 15 '22 11:11

James Howell


1 Answers

The title is refreshed via Javascript when you close the pop-up window. It's possible that you have some sort of cross-domain issue which is preventing the JS from running - this does sometimes occur when you're running via the development server on eg port 8080.

Have a look at what the console in Firebug is showing you (you are using Firebug to debug Javascript problems, aren't you?).

like image 196
Daniel Roseman Avatar answered Nov 23 '22 01:11

Daniel Roseman