Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Motaz Hejaze
nice to know, good luck

On Wed, Apr 22, 2020 at 5:35 AM Ahmed Khairy 
wrote:

> Thank you so much it is realyy helpfull. Fixed it
>
> On Tuesday, April 21, 2020 at 11:23:10 PM UTC-4, Motaz Hejaze wrote:
>>
>> check this out
>>
>> https://wsvincent.com/django-allauth-tutorial-custom-user-model/
>>
>> On Wed, Apr 22, 2020 at 5:18 AM Ahmed Khairy 
>> wrote:
>>
>>> What do you mean ?
>>>
>>> On Tuesday, April 21, 2020 at 11:13:16 PM UTC-4, Motaz Hejaze wrote:
>>>>
>>>> did you define managers ?
>>>>
>>>> On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy 
>>>> wrote:
>>>>
>>>>> Model Form
>>>>>
>>>>> UserCreationForm
>>>>>
>>>>> On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>>>>>>
>>>>>> what kind of forms is this ? regular form or model form ?
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> Got this unexpected error all of a sudden, how to fix it.
>>>>>>>
>>>>>>> save() got an unexpected keyword argument 'force_insert'
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> def register(request):
>>>>>>> if request.method == 'POST':
>>>>>>> form = UserRegisterForm(request.POST)
>>>>>>> if form.is_valid():
>>>>>>> form.save()
>>>>>>> username = form.cleaned_data.get('username')
>>>>>>> messages.success(
>>>>>>> request, f
>>>>>>> 'Your account has been created! You are now able to log in')
>>>>>>> return redirect('login')
>>>>>>> else:
>>>>>>> form = UserRegisterForm()
>>>>>>> return render(request, 'register.html', {'form': form})
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Django users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to django...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3983161c-10b7-4e0d-b2ba-8dbf83e3b890%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3983161c-10b7-4e0d-b2ba-8dbf83e3b890%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-f_4Y%3DTNETUSJNEOuoo0iU7e1T-QPEvsK98F1eB9JB0Dg%40mail.gmail.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Thank you so much it is realyy helpfull. Fixed it 

On Tuesday, April 21, 2020 at 11:23:10 PM UTC-4, Motaz Hejaze wrote:
>
> check this out
>
> https://wsvincent.com/django-allauth-tutorial-custom-user-model/
>
> On Wed, Apr 22, 2020 at 5:18 AM Ahmed Khairy  > wrote:
>
>> What do you mean ? 
>>
>> On Tuesday, April 21, 2020 at 11:13:16 PM UTC-4, Motaz Hejaze wrote:
>>>
>>> did you define managers ?
>>>
>>> On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy  
>>> wrote:
>>>
>>>> Model Form 
>>>>
>>>> UserCreationForm
>>>>
>>>> On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>>>>>
>>>>> what kind of forms is this ? regular form or model form ?
>>>>>
>>>>>
>>>>> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy  
>>>>> wrote:
>>>>>
>>>>>> Hi all, 
>>>>>>
>>>>>> Got this unexpected error all of a sudden, how to fix it. 
>>>>>>
>>>>>> save() got an unexpected keyword argument 'force_insert'
>>>>>>
>>>>>>
>>>>>>
>>>>>> def register(request):
>>>>>> if request.method == 'POST':
>>>>>> form = UserRegisterForm(request.POST)
>>>>>> if form.is_valid():
>>>>>> form.save()
>>>>>> username = form.cleaned_data.get('username')
>>>>>> messages.success(
>>>>>> request, f
>>>>>> 'Your account has been created! You are now able to log in')
>>>>>> return redirect('login')
>>>>>> else:
>>>>>> form = UserRegisterForm()
>>>>>> return render(request, 'register.html', {'form': form})
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to django...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to django...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3983161c-10b7-4e0d-b2ba-8dbf83e3b890%40googlegroups.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Thank you so much it realyy helpfull. Fixed it 

On Tuesday, April 21, 2020 at 11:23:10 PM UTC-4, Motaz Hejaze wrote:
>
> check this out
>
> https://wsvincent.com/django-allauth-tutorial-custom-user-model/
>
> On Wed, Apr 22, 2020 at 5:18 AM Ahmed Khairy  > wrote:
>
>> What do you mean ? 
>>
>> On Tuesday, April 21, 2020 at 11:13:16 PM UTC-4, Motaz Hejaze wrote:
>>>
>>> did you define managers ?
>>>
>>> On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy  
>>> wrote:
>>>
>>>> Model Form 
>>>>
>>>> UserCreationForm
>>>>
>>>> On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>>>>>
>>>>> what kind of forms is this ? regular form or model form ?
>>>>>
>>>>>
>>>>> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy  
>>>>> wrote:
>>>>>
>>>>>> Hi all, 
>>>>>>
>>>>>> Got this unexpected error all of a sudden, how to fix it. 
>>>>>>
>>>>>> save() got an unexpected keyword argument 'force_insert'
>>>>>>
>>>>>>
>>>>>>
>>>>>> def register(request):
>>>>>> if request.method == 'POST':
>>>>>> form = UserRegisterForm(request.POST)
>>>>>> if form.is_valid():
>>>>>> form.save()
>>>>>> username = form.cleaned_data.get('username')
>>>>>> messages.success(
>>>>>> request, f
>>>>>> 'Your account has been created! You are now able to log in')
>>>>>> return redirect('login')
>>>>>> else:
>>>>>> form = UserRegisterForm()
>>>>>> return render(request, 'register.html', {'form': form})
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to django...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to django...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2633ef13-a6a3-449e-ae91-f175cf7ea37a%40googlegroups.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Motaz Hejaze
check this out

https://wsvincent.com/django-allauth-tutorial-custom-user-model/

On Wed, Apr 22, 2020 at 5:18 AM Ahmed Khairy 
wrote:

> What do you mean ?
>
> On Tuesday, April 21, 2020 at 11:13:16 PM UTC-4, Motaz Hejaze wrote:
>>
>> did you define managers ?
>>
>> On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy 
>> wrote:
>>
>>> Model Form
>>>
>>> UserCreationForm
>>>
>>> On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>>>>
>>>> what kind of forms is this ? regular form or model form ?
>>>>
>>>>
>>>> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy 
>>>> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Got this unexpected error all of a sudden, how to fix it.
>>>>>
>>>>> save() got an unexpected keyword argument 'force_insert'
>>>>>
>>>>>
>>>>>
>>>>> def register(request):
>>>>> if request.method == 'POST':
>>>>> form = UserRegisterForm(request.POST)
>>>>> if form.is_valid():
>>>>> form.save()
>>>>> username = form.cleaned_data.get('username')
>>>>> messages.success(
>>>>> request, f
>>>>> 'Your account has been created! You are now able to log in')
>>>>> return redirect('login')
>>>>> else:
>>>>> form = UserRegisterForm()
>>>>> return render(request, 'register.html', {'form': form})
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-dwQZmnjuP%3DEKfAQ-6_sGS7ejLrvA_o8VcHh4DYBPA%3DCA%40mail.gmail.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
What do you mean ? 

On Tuesday, April 21, 2020 at 11:13:16 PM UTC-4, Motaz Hejaze wrote:
>
> did you define managers ?
>
> On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy  > wrote:
>
>> Model Form 
>>
>> UserCreationForm
>>
>> On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>>>
>>> what kind of forms is this ? regular form or model form ?
>>>
>>>
>>> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy  
>>> wrote:
>>>
>>>> Hi all, 
>>>>
>>>> Got this unexpected error all of a sudden, how to fix it. 
>>>>
>>>> save() got an unexpected keyword argument 'force_insert'
>>>>
>>>>
>>>>
>>>> def register(request):
>>>> if request.method == 'POST':
>>>> form = UserRegisterForm(request.POST)
>>>> if form.is_valid():
>>>> form.save()
>>>> username = form.cleaned_data.get('username')
>>>> messages.success(
>>>> request, f
>>>> 'Your account has been created! You are now able to log in')
>>>> return redirect('login')
>>>> else:
>>>> form = UserRegisterForm()
>>>> return render(request, 'register.html', {'form': form})
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to django...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/affd82c8-1b8c-46a0-85c0-a3a5c6939abe%40googlegroups.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Motaz Hejaze
did you define managers ?

On Wed, Apr 22, 2020 at 5:06 AM Ahmed Khairy 
wrote:

> Model Form
>
> UserCreationForm
>
> On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>>
>> what kind of forms is this ? regular form or model form ?
>>
>>
>> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy 
>> wrote:
>>
>>> Hi all,
>>>
>>> Got this unexpected error all of a sudden, how to fix it.
>>>
>>> save() got an unexpected keyword argument 'force_insert'
>>>
>>>
>>>
>>> def register(request):
>>> if request.method == 'POST':
>>> form = UserRegisterForm(request.POST)
>>> if form.is_valid():
>>> form.save()
>>> username = form.cleaned_data.get('username')
>>> messages.success(
>>> request, f
>>> 'Your account has been created! You are now able to log in')
>>> return redirect('login')
>>> else:
>>> form = UserRegisterForm()
>>> return render(request, 'register.html', {'form': form})
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-fDDbB_X01d8HOvOAZSkPegVw_O%3DzbBDVGaWM72V4Xypg%40mail.gmail.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Model Form 

UserCreationForm

On Tuesday, April 21, 2020 at 11:02:13 PM UTC-4, Motaz Hejaze wrote:
>
> what kind of forms is this ? regular form or model form ?
>
>
> On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy  > wrote:
>
>> Hi all, 
>>
>> Got this unexpected error all of a sudden, how to fix it. 
>>
>> save() got an unexpected keyword argument 'force_insert'
>>
>>
>>
>> def register(request):
>> if request.method == 'POST':
>> form = UserRegisterForm(request.POST)
>> if form.is_valid():
>> form.save()
>> username = form.cleaned_data.get('username')
>> messages.success(
>> request, f
>> 'Your account has been created! You are now able to log in')
>> return redirect('login')
>> else:
>> form = UserRegisterForm()
>> return render(request, 'register.html', {'form': form})
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4a164104-3cab-4d97-a6ac-47b9a3ed98dd%40googlegroups.com.


Re: save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Motaz Hejaze
what kind of forms is this ? regular form or model form ?


On Wed, Apr 22, 2020 at 4:57 AM Ahmed Khairy 
wrote:

> Hi all,
>
> Got this unexpected error all of a sudden, how to fix it.
>
> save() got an unexpected keyword argument 'force_insert'
>
>
>
> def register(request):
> if request.method == 'POST':
> form = UserRegisterForm(request.POST)
> if form.is_valid():
> form.save()
> username = form.cleaned_data.get('username')
> messages.success(
> request, f
> 'Your account has been created! You are now able to log in')
> return redirect('login')
> else:
> form = UserRegisterForm()
> return render(request, 'register.html', {'form': form})
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-fvxt2655FMSMcBoRamCKHEVHY89ZMDwQp%3D6rPxaN2TLw%40mail.gmail.com.


save() got an unexpected keyword argument 'force_insert'

2020-04-21 Thread Ahmed Khairy
Hi all, 

Got this unexpected error all of a sudden, how to fix it. 

save() got an unexpected keyword argument 'force_insert'



def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
messages.success(
request, f
'Your account has been created! You are now able to log in')
return redirect('login')
else:
form = UserRegisterForm()
return render(request, 'register.html', {'form': form})

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/be6de004-4a69-4346-8a12-99eced8d76a3%40googlegroups.com.


Re: save() got an unexpected keyword argument 'force_insert'

2012-09-25 Thread Dan Gentry
To address the original question, I saw a similar error when overriding the 
save() function of a model.  The solution was to include *args and **kwargs 
in the function definition:

def save(self,*args, **kwargs):
# your custom code here #
super(MyModel, self).save(*args, **kwargs)


>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/vYCgvZ74BEQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: save() got an unexpected keyword argument 'force_insert'

2012-09-24 Thread Joel Goldstick
On Mon, Sep 24, 2012 at 12:51 AM, Laxmikant Gurnalkar
 wrote:
>
> Hi guys,
> Anybody knows why I'm at this stage ?
> Group.objects.using('db2').get_or_create(name='Maintenance Admin')
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
> 383, in get_or_create
>     obj.save(force_insert=True, using=self.db)
> TypeError: save() got an unexpected keyword argument 'force_insert'
>
>
> I'm getting this error on creating a new group on mydatabase2
> Not getting the exact reason behind this ...
> plz help ...
>
> Thanks in Advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/4Rosfupipe4J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

This is the first google entry for your error message:

https://code.djangoproject.com/ticket/8662

It looks like the docs were wrong, but they have been fixed.

-- 
Joel Goldstick

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



save() got an unexpected keyword argument 'force_insert'

2012-09-24 Thread Laxmikant Gurnalkar

Hi guys, 
Anybody knows why I'm at this stage ?
Group.objects.using('db2').get_or_create(name='Maintenance Admin')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 
383, in get_or_create
obj.save(force_insert=True, using=self.db)
TypeError: save() got an unexpected keyword argument 'force_insert'


I'm getting this error on creating a new group on mydatabase2
Not getting the exact reason behind this ...
plz help ...

Thanks in Advance

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/4Rosfupipe4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.