[Django] #32877: request.POST sending array

8 views
Skip to first unread message

Django

unread,
Jun 23, 2021, 6:16:08 AM6/23/21
to django-...@googlegroups.com
#32877: request.POST sending array
-------------------------------------+-------------------------------------
Reporter: LAHRIZI | Owner: nobody
Ahmed |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 3.2
Uncategorized | Keywords: request,
Severity: Normal | request.POST, post, request.post,
| array, list, OOP, oop, kwarg,
Triage Stage: | kwargs
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm facing this issue with `request.POST`, i have a form and when im
trying to acess it in my class `User`, i'm giving it all the arguments
from `request.POST`
{{{#!python
new_user = User(**request.POST)
}}}
(to make it work i use `**trash_args`)
{{{#!python
def __init__(arg1, arg2, **trash_args):
stuff()
return
}}}
the problem is when i print my arguments in the init i get `[value]`
instead of `value` (it in a list),

is it related to this issue ?
https://code.djangoproject.com/ticket/1130

here are my two files on github

https://github.com/ahmedlahrizi/crm/blob/7dbd6f222b66c59dfa7b6f1aebdad7f71d1178dd/crm/api/crm.py#L79
https://github.com/ahmedlahrizi/crm/blob/main/crm/contacts/views.py

Thank you !

--
Ticket URL: <https://code.djangoproject.com/ticket/32877>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 23, 2021, 6:17:40 AM6/23/21
to django-...@googlegroups.com
#32877: request.POST sending array
-------------------------------------+-------------------------------------
Reporter: LAHRIZI Ahmed | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution:
Keywords: request, | Triage Stage:
request.POST, post, request.post, | Unreviewed

array, list, OOP, oop, kwarg, |
kwargs |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by LAHRIZI Ahmed:

Old description:

> I'm facing this issue with `request.POST`, i have a form and when im
> trying to acess it in my class `User`, i'm giving it all the arguments
> from `request.POST`
> {{{#!python
> new_user = User(**request.POST)
> }}}
> (to make it work i use `**trash_args`)
> {{{#!python
> def __init__(arg1, arg2, **trash_args):
> stuff()
> return
> }}}
> the problem is when i print my arguments in the init i get `[value]`
> instead of `value` (it in a list),
>
> is it related to this issue ?
> https://code.djangoproject.com/ticket/1130
>
> here are my two files on github
>
> https://github.com/ahmedlahrizi/crm/blob/7dbd6f222b66c59dfa7b6f1aebdad7f71d1178dd/crm/api/crm.py#L79
> https://github.com/ahmedlahrizi/crm/blob/main/crm/contacts/views.py
>
> Thank you !

New description:

I'm facing this issue with `request.POST`, i have a form and when im
trying to acess it in my class `User`, i'm giving it all the arguments
from `request.POST`
{{{#!python
new_user = User(**request.POST)
}}}
(to make it work i use `**trash_args`)
{{{#!python
def __init__(arg1, arg2, **trash_args):
stuff()
return
}}}
the problem is when i print my arguments in the init i get `[value]`
instead of `value` (it in a list),

is it related to this issue ?
https://code.djangoproject.com/ticket/1130

here are my two files on github

edi(i sent the wrong line):
https://github.com/ahmedlahrizi/crm/blob/7dbd6f222b66c59dfa7b6f1aebdad7f71d1178dd/crm/api/crm.py#L15
https://github.com/ahmedlahrizi/crm/blob/main/crm/contacts/views.py

Thank you !

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32877#comment:1>

Django

unread,
Jun 23, 2021, 6:56:14 AM6/23/21
to django-...@googlegroups.com
#32877: request.POST sending array
-------------------------------------+-------------------------------------
Reporter: LAHRIZI Ahmed | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution: invalid

Keywords: request, | Triage Stage:
request.POST, post, request.post, | Unreviewed
array, list, OOP, oop, kwarg, |
kwargs |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

Please don't use Trac as a support channel. If you're having trouble
understanding how Django works, see
TicketClosingReasons/UseSupportChannels for ways to get help.

--
Ticket URL: <https://code.djangoproject.com/ticket/32877#comment:2>

Reply all
Reply to author
Forward
0 new messages