我最近移植了django 1.4应用程序以使用gunicorn运行。 但移植后,管理页面中没有出现很少的内联链接。该问题是否与admin CSS有关。请帮忙。我附上了图片。
这是与原版django管理站点 -
这是与gunicorn管理站点(注意 - '添加另一个prod comp ...'链接在底部消失')
model.py的片段
class Resource(models.Model):
resource_id = models.AutoField(primary_key=True)
proj_sub_category = models.CharField(max_length=135, blank=True)
resource_prod_comp_view = models.ForeignKey(ResourceProdCompView)
class Meta:
db_table = u'resource'
verbose_name_plural = "Resource Map (Product Component Association)"
def __unicode__(self):
return self.name
def res__prod_list(self):
return self.resource_prod_comp_view.prod_list
class ProdRelCompResourceMap(models.Model):
prod_rel_comp_resource_map_id = models.AutoField(primary_key=True)
resource = models.ForeignKey(Resource, related_name='prod_rel_comp_resource_map_resource', null=True, blank=True)
product = models.ForeignKey(Product, related_name='prod_rel_comp_resource_map_product', null=True, blank=True)
prod_rel_comp = models.ForeignKey(ProdRelComp, null=True, blank=True)
class Meta:
db_table = u'prod_rel_comp_resource_map'
verbose_name_plural = "Resource Map (Product/Component Association)"
def __unicode__(self):
mycomp = self.prod_rel_comp.prod_comp.component.name
self.name = self.product.name + '__' + mycomp
return self.name
admin.py小部件
class ProdRelCompResourceMapInline(admin.TabularInline):
model = ProdRelCompResourceMap
extra = 0
class ResourceAdmin(admin.ModelAdmin):
save_as = True
save_on_top = True
fieldsets = ((None, {'fields': (('name', 'lname', 'fname'),
('emp_code', 'emptype', 'manager_email'), (
'office_location', 'badge'), ('b_group_code',))}), )
exclude = ['proj_sub_category','b_group','location',]
list_display = (
'name',
'res__prod_list',
'emp_code',
'emptype',
'manager_email',
'office_location',
'fname',
'lname',
'b_group_code',
'badge',
)
list_filter = ('emp_code', 'emptype', 'b_group_code', 'office_location')
list_per_page = 100
search_fields = ['name', 'proj_sub_category',]
inlines = [ProdCompAttsResourceMapInline,]
admin.site.register(Resource, ResourceAdmin)