You’re passing a string instead of a variable.
c = contact(email=email,subject=subject,message=message)

On Wed, 15 May 2019 at 4:33 PM, Chetan Ganji <ganji.che...@gmail.com> wrote:

> *Problem - *
> def *contact*(request):
>       ......
>       c = *contact*(email='email',subject='subject',message='message')
>       ......
>
> The two methods that should be doing two separate things have the same
> name. So, the python interpreter is confused.
>
> *Solution - *
> Rename anyone of the above methods.
>
> Regards,
> Chetan Ganji
> +91-900-483-4183
> ganji.che...@gmail.com
> http://ryucoder.in
>
>
> On Wed, May 15, 2019 at 3:50 PM Emmanuel klutse <nuelk...@gmail.com>
> wrote:
>
>> Hello Team,
>> I need help please, I’m try to save to my db from a FORM using the
>> command below.
>> I’ve all I could but the process keeps failing and I’m stack.
>>
>> File
>> "/Users/emmanuelklutse/Documents/djangodev/myPortfolio/emmanuel/views.py", l
>> ine 17, in contact
>>     c = contact(email='email',subject='subject',message='message')
>> TypeError: contact() got an unexpected keyword argument ‘email'
>>
>>
>> def contact(request):
>>     if request.method == 'POST':
>>         email = request.POST.get('email')
>>         subject = request.POST.get('subject')
>>         message = request.POST.get('message')
>>
>>         c = contact(email='email',subject='subject',message='message')
>>         c.save()
>>
>>         return render (request,'emmanuel/contact.html')
>>     else:
>>         return render (request,'emmanuel/contact.html’)
>>
>>
>> Thanks,
>> Emmanuel klutse. Best regards
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/D5902281-068C-448D-8C3B-4661EC37473A%40gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMKMUjv5c7WoQ8aZzZWgm%3DZxoEs0zX3nVeQC_yiTzKKiHGUVkw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMKMUjv5c7WoQ8aZzZWgm%3DZxoEs0zX3nVeQC_yiTzKKiHGUVkw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFhdOCMV%3DRjUNmdVsm1etNLN2yfU64bvgUV3XWWhPWSk-FC_8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to