': user}*
> *serializer = **UploadSerializer**(data=data)*
>
>
>
>
> *if serializer.is_valid():serializer.save()
> return Response(serializer.data, status=status.HTTP_201_CREATED)
> return Response(serializer.errors, status=status.HT
Do you have an UploadForm already in your forms.py? if yes, show me with
> the view that handles.
>
> On Thu, Jul 30, 2020 at 11:59 AM Dinolin yp job
> wrote:
>
>>
>>
>> It worked but user_id column in uploads_upload table is empty. How to
>> solve this issue?
&g
del.py, the User foreign key
> does not have a null=True, and blank=True. So you can't save a null value
> for that user field.
>
> On Thu, Jul 30, 2020 at 10:52 AM Dinolin yp job
> wrote:
>
>> I'm trying to save image in postgres database. I have upload model
y, the User foreign key
> does not have a null=True, and blank=True. So you can't save a null value
> for that user field.
>
> On Thu, Jul 30, 2020 at 10:52 AM Dinolin yp job
> wrote:
>
>> I'm trying to save image in postgres database. I have upload model whic
I'm trying to save image in postgres database. I have upload model which
has a foreign key reference to the extended custom user model. But it shows
the following error
uploads/model.py
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class U
5 matches
Mail list logo