Admin Raw ID widgets can show broken magnifying glass link
|Reported by:||ramiro||Owned by:||ramiro|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by ramiro)
This can happen when the related model isn't registered with the same admin site.
Ideally these widgets should behave in a way consistent with the regular non-raw ID admin widgets in this regard.
# models.py from django.db import models class Honeycomb(models.Model): location = models.CharField(max_length=20) class Bee(models.Model): honeycomb = models.ForeignKey(Honeycomb)
# admin.py from django.contrib import admin import models class BeeAdmin(admin.ModelAdmin): raw_id_fields = ('honeycomb',) admin.site.register(models.Bee)
Try to add a Bee instance, in the add view click in the magnifying glass besides the 'Honeycomb' field, this leads to a 404 error.
Change History (7)
comment:1 Changed 4 years ago by ramiro
- Description modified (diff)
- Owner changed from nobody to ramiro