Hi,

Sorry for mixing those things up - I was writing from the top of my head
and not really paying that much attention perhaps :)

I would like to give you a few other pointers:
1. This is a bit biased but I would try to get away from function based
views - because they tend to make you do a lot of code duplication (in my
view - and I know I am opinionated here).
2. I am not really sure that you should use URL based things in your case -
but if you want to fine - I would probably use query params instead (and
get it off the request object instead).
3. Django IS really simple - probably one of the easiest things to create
but complicated and simple websites in :)

I would recommend that you look to a good tutorial to get started - the
django girls tutorial is one of the best:
https://tutorial.djangogirls.org/en/

Regards,

Andréas


Den tors 7 maj 2020 kl 17:08 skrev Ekberg Peter <npc.ekb...@gmail.com>:

> This is what I had to do. Thanks to you I know how to think and fixed it.
>
>
> xx="EXTRA ARGUMENT"
>  return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,)))
>
>
>  path('<int:question_id>/<str:xx>/result/', views.result, name='result'),
>
>
>  def result(request, question_id, xx):
>
>
>
> Den torsdag 7 maj 2020 kl. 12:40:06 UTC+2 skrev Ekberg Peter:
>>
>> I know something like this has been asked before but I never seen any
>> answer that I can understand or that works. But I am very new on Django so
>> maybe I could have missed it. But there must be an easy answer to my
>> question. I am following the tutorial for Django and at section 4 they use
>> the httpresponseredirect to go to next page after posting a form.
>>
>>
>> return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))
>>
>> The views page function looks like this:
>>
>>
>> def detail(request, question_id):
>>
>> My question is: How can I send more arguments than the question.id to
>> the function?
>>
>> Thx
>>
> --
> 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/ddc94715-8c83-4060-bfd5-8c336d4fc900%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ddc94715-8c83-4060-bfd5-8c336d4fc900%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/CAK4qSCfafVJOUng3poG%3DX8QzC1nh36OAGFYtgUUwM1u-PF3yHQ%40mail.gmail.com.

Reply via email to