Django header - raw_id_fields not updated

I am having a problem when using raw_id_field inside admin.py in my Django project.

In my site administration area there are several fields for uploading images for different model pages, which are ForeignKey fields for the image model, where all the images for the site are stored. Since the site will ultimately deal with a large number of images (100, maybe 1000 s), the default selection box will be unusable.

I created various admin.ModelAdmin classes like

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

This changes the image selector within my edit pages from the "Select" field to the "Raw field" field.

However, when I select another image using this control, although the identifier of the new image is displayed, the caption from the previous image is still displayed.

Any ideas?

+5
source share
2 answers

The header is updated via Javascript when the popup closes. Perhaps you have some kind of cross-domain problem that prevents JS from starting - this sometimes happens when you work through a development server, for example, on port 8080.

See what the console shows in Firebug (you use Firebug to debug Javascript problems, right?).

+1
source

firebug , . "" , . "" , raw_id.

0

All Articles