如何更改第三方Django应用程序的字段或模型属性? [英] How do I change field or model attributes of a third-party Django app?

查看:92
本文介绍了如何更改第三方Django应用程序的字段或模型属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在项目中使用django.contrib.flatpages或任何其他第三方应用程序。我想更改这个应用程序的一些模型属性 - 例如,verbose_name。
我该怎么做?

解决方案

简单的答案是不要请改用代理模型


Let's say, I use django.contrib.flatpages, or any other third-party app in my project. I want to change some of this app's model attributes - for example, verbose_name. How can I do that?

解决方案

The simple answer is "don't"; use a proxy model instead.

这篇关于如何更改第三方Django应用程序的字段或模型属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆