Changes between Initial Version and Version 1 of Ticket #11163
- Timestamp:
- May 20, 2009, 4:17:16 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11163 – Description
initial v1 1 1 When the user specifies in their admin.py that a field is both editable and a raw_id, like this: 2 2 3 {{{ 3 4 list_editable = ('owner',) 4 5 raw_id_fields = ('owner',) 6 }}} 5 7 6 8 the ForeignKeyRawIdWidget is used in the change list view for that field. However, the code in the ForeignKeyRawIdWidget's render() method is hardcoded to be called from the edit form, with the following code: 7 9 10 {{{ 8 11 related_url = '../../../%s/%s/' % (self.rel.to._meta.app_label, self.rel.to._meta.object_name.lower()) 12 }}} 9 13 10 14 When called from the change list, the url has one less entry than when called from the edit form. As a result, the link is wrong when called from the change list. For example, the url for the changelist is something like this: