开发者

Django model classes with the same field names and Admin

开发者 https://www.devze.com 2023-02-13 23:26 出处:网络
I have a model which has been working up until now. The model has 2 classes that both have some fields with the same name. I had admin customised for class1 but not 2, although class 2 was registered

I have a model which has been working up until now. The model has 2 classes that both have some fields with the same name. I had admin customised for class1 but not 2, although class 2 was registered with the admin so I could edit it. Now I want to customise class2 in the admin but 开发者_高级运维then I start getting _ name _ errors.

I think it is caused by the field names being the same in the different classes.

How can I setup the admin so it will work with 2 nearly identical classes


It turns out the error was being caused by:

filter_horizontal = ('screenshots')

Note the missing comma after the screenshots item:

filter_horizontal = ('screenshots',)

Thanks for having a look

0

精彩评论

暂无评论...
验证码 换一张
取 消