tickets_full: 3345

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
3345 2007-01-22 01:37:10 2007-03-15 04:13:32 2019-06-24 00:50:52.673820 Design decision needed closed contrib.admin       invalid Admin Search Fields From Related Models I'm trying to in the Admin Change List Form have the ability to search records via information from a related model. Example When in case_files I would like to search by Company Name, this information is stored in a separate object. Can this be possible? Below is a sample of the models.py Regards {{{ class company_record(models.Model): midas_number = models.CharField(maxlength=10, verbose_name='Midas Number') company_name = models.CharField(maxlength=200, verbose_name='Company Name') midas_parent = models.CharField(maxlength=10, verbose_name='Midas Parent Member Number') parent_name = models.CharField(maxlength=200, verbose_name='Parent Company Name') company_status = models.CharField(maxlength=100, verbose_name='Member Current Status') company_cat = models.CharField(maxlength=10, verbose_name='Company Category') def __str__(self): return self.midas_number + " - " + self.company_name class Admin: pass list_display = ('midas_number', 'company_name', 'midas_parent', 'parent_name', 'company_status', 'company_cat') list_display_links = ('midas_number', 'company_name') list_filter = ('company_cat', 'company_status') search_fields = ['company_name'] class Meta: verbose_name = "Company Record" class case_file(models.Model): midas_number_id = models.AutoField(primary_key=True) midas_number = models.ForeignKey(company_record, edit_inline=models.STACKED, num_in_admin=1, verbose_name="Company Name") fileid = models.CharField(maxlength=10, core=True, primary_key=True, verbose_name='File ID') file_state = models.CharField(maxlength=3, core=True, verbose_name='State') file_status = models.CharField(maxlength=10, core=True, verbose_name='File Current Status') file_open_date = models.DateField('File Open Date', core=True) file_close_date = models.DateField('File Close Date', core=True) owning_officer = models.CharField(maxlength=200, core=True, verbose_name='"Owning" Officer') owning_dept = models.CharField(maxlength=200, core=True, verbose_name='"Owning" Department') nature_of_matter = models.CharField(maxlength=200, core=True, verbose_name='Nature Of Matter') destroy_date = models.DateField('Destroy Date', core=True) purchase_order = models.CharField(maxlength=50, core=True, verbose_name='Purchase Order#') document_desc = models.CharField(maxlength=200, core=True, verbose_name='Description of Document') class Admin: fields = ( ('File Status Details', {'fields': ('midas_number', 'fileid', 'file_state', 'file_status', 'file_open_date', 'file_close_date', 'destroy_date')}), ('File Details', {'fields': ('owning_officer', 'owning_dept', 'nature_of_matter', 'purchase_order', 'document_desc')}), ) list_select_related = True search_fields = ['fileid', 'owning_officer', 'midas_number_id'] list_display = ('midas_number', 'fileid', 'owning_officer', 'owning_dept', 'document_desc', 'file_status' ) list_display_links = ('midas_number', 'fileid') list_filter = ('owning_officer', 'owning_dept', 'nature_of_matter', 'file_status', 'file_open_date' ) class Meta: verbose_name = "Case File" }}} adrian rfreitag@aigroup.asn.au   0 0 0 0 0 0
Powered by Datasette · Query took 2.926ms