| 11 | |
| 12 | This doesn't work either, where 'hardware_arch' is the only foreign key referenced in search_fields: |
| 13 | |
| 14 | |
| 15 | {{{ |
| 16 | class HardwareArchitecture(models.Model): |
| 17 | name = models.CharField('Architecture', |
| 18 | primary_key=True, |
| 19 | max_length=40) |
| 20 | #... |
| 21 | |
| 22 | class Device(models.Model): |
| 23 | #... |
| 24 | hardware_arch = models.ForeignKey(HardwareArchitecture, |
| 25 | blank=True, |
| 26 | null=True, |
| 27 | on_delete=models.DO_NOTHING) |
| 28 | |
| 29 | }}} |
| 30 | |
| 31 | {{{ |
| 32 | class DeviceAdmin(admin.ModelAdmin): |
| 33 | search_fields = ['name', 'hardware_arch__name', 'afs_sysname', 'afs_client_r |
| 34 | ev', 'propertyno', 'calc_roles', 'notes'] |
| 35 | |
| 36 | }}} |
| 37 | |