Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

外键嵌入修改异常 #727

Open
ouyangqr opened this issue Dec 3, 2020 · 1 comment
Open

外键嵌入修改异常 #727

ouyangqr opened this issue Dec 3, 2020 · 1 comment

Comments

@ouyangqr
Copy link

ouyangqr commented Dec 3, 2020

image
wom我们修改这里面的字段保存的时候发现数据没有保存到数据库里面.choise字段也不能获取对应的选项

@ouyangqr
Copy link
Author

ouyangqr commented Dec 3, 2020

class ContentXXXXImageInfo:
model = ContentXXXXImage
extra = 0

def get_readonly_fields(self):
    """  重新定义此函数,限制普通用户所能修改的字段  """
    return self.readonly_fields

readonly_fields = ('image_id',)

class ContentXXXXadmin:
model = ContentXXXX
extra = 0
list_display = ("xxx",)

inlines = [ContentXXXXImageInfo, ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant