﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26380	'FileField' attribute has no file associated with it	Mehdy Haghy	nobody	"I've a FileField in a model which is marked as nullable but when I want to serialize the model

instead of null value it throws an exception: 
'profile_img' attribute has no file associated with it

How can I get null or blank when the value of FileFiled is null?
I've seen a few workaround to handle this in template but since 
I'm using this in DRF so there's no way to handle.

 {{{#!python
class UserProfile(models.Model):
  owner = models.OneToOneField('auth.User', related_name='userprofile', default=-1)
  profile_img= models.FileField(upload_to='profiles', blank=True, null=True)


class UserProfileSerializer(serializers.ModelSerializer):

    owner = UserSerializer()
    class Meta:
        model = UserProfile
        fields=('pk','profile_img')

}}}"	Cleanup/optimization	closed	Database layer (models, ORM)	1.9	Normal	duplicate	Null Handling FIleField ImageField		Unreviewed	0	0	0	0	0	0
