Thanks required=False is what I needed :).
"ImageField is not required as expected" Isn't that what you want? :) Yes
that is exactly what I wanted but also wanted to display the actual
setting the required=False allows me to have my cake and eat it too :). Not
sure why required vs blank,
NOTE: I tried adding null=True, blank=True to forms.ImageField however I
> get errors __init__() got an unexpected keyword argument so I guess I can't
> use them options. If I comment out the def formfield_for_dbfield(self,
> db_field, **kwargs): then the ImageField is not required as
Update:
Looks like it was an issue with the admin.py file custom code, I was
following a code sample to display images inline which is causing the field
to become required. Any suggestions on how to fix this? (See code below)
class AdminImageFieldWithThumbWidget(forms.widgets.FileInput):
Hi,
I have a picture for my custom user declared as follows:
class CustomUser(AbstractBaseUser):
picture = models.ImageField(upload_to='profile_pictures', null=True,
blank=True)
In admin I use the image
class CustomUserAdmin(UserAdmin):
fieldsets(
('Profile details', {
4 matches
Mail list logo