用于将多个数据传递到模板的通用视图

loading...


0

字段值不显示在模板中仅显示extrainfo . 我想显示(字段)和(extrainfo)值

class CompanyUpdateView(UpdateView):
    model = Company
    fields = ['company_name', 'company_description','company_email',
    'company_phone', 'company_address', 'company_website'
    , 'company_status', 'company_monthly_payment']
    def get_context_data(self, **context):
        context[self.context_object_name] = self.object
        context["extrainfo"] = "Processador123123"
        return context

loading...

0回答

No Data

评论

暂时没有评论!