Moving from 1.6.4 to 1.7.3 the listing in the Admin UI is not resolving a related field now. There are not any model changes involved.
Attached are two screen shots named for the versions.
I haven't changed the admin code either. For the screen shots the admin code is:
class DvBooleanAdmin(admin.ModelAdmin):
list_filter = ['prj_name__rm_version__version_id','prj_name',]
search_fields = ['data_name','ct_id']
ordering = ['prj_name','data_name']
actions = [make_published, unpublish, copy_dt, republish]
readonly_fields = ['published','schema_code','r_code','xqr_code','xqw_code',]
def get_form(self, request, obj=None, **kwargs):
try:
if obj.published:
self.readonly_fields = ['prj_name','published','lang','schema_code','data_name','valid_trues','valid_falses','description','sem_attr','resource_uri','asserts','xqr_code','xqw_code',]
except (AttributeError, TypeError) as e:
self.readonly_fields = ['published','schema_code','r_code','xqr_code','xqw_code',]
return super(DvBooleanAdmin, self).get_form(request, obj, **kwargs)
fieldsets = (
(None, {'classes':('wide',),
'fields':('published','prj_name','data_name','lang','valid_trues','valid_falses')}),
("Additional Information ", {'classes':('wide',),
'fields':('description','sem_attr','resource_uri','asserts',)}),
("PCT Code (read-only)", {'classes':('collapse',),
'fields':('schema_code','r_code','xqr_code','xqw_code',)}),
)
list_display = ('data_name','prj_name','published',)
admin.site.register(DvBoolean, DvBooleanAdmin)
In the model for the displayed admin:
prj_name = models.ForeignKey(Project, verbose_name=_("Project Name"), to_field="prj_name", help_text=_('Choose the name of your Project.'))
and the related field in Project is:
prj_name = models.CharField(_("project name"), max_length=110, unique=True, db_index=True, help_text=_('Enter the name of your project.'))
...
def __unicode__(self):
return self.prj_name
Any ideas?
Should I file a bug report?
Thanks,
Tim