Ad

Django ImageField Core=False In Newforms Admin

- 1 answer

In the transition to newforms admin I'm having difficulty figuring out how specify core=False for ImageFields.

I get the following error:

TypeError: __init__() got an unexpected keyword argument 'core'

[Edit] However, by just removing the core argument I get a "This field is required." error in the admin interface on attempted submission. How does one accomplish what core=False is meant to do using newforms admin?

Ad

Answer

To get rid of "This field is required," you need to make it not required, by using blank=True (and possibly null=True as well, if it's not a CharField).

Ad
source: stackoverflow.com
Ad