Thanks for the link. I understand these examples but still I would like to
see how a view function is defined.

I also would like to see it in PyCharm. When I click on a view function in
PyCharm I only see:

def myview_function(request)
Inferred type: (request: Any) -> HttpResponse

I would expect to see something like this:
view_function(request, *args, **kwargs)

I've also looked in django's source but I cannot locate it.

On Fri, May 12, 2017 at 3:05 PM, nickeforos <[email protected]> wrote:

> I'm following the django tutorials and documentaion as well as the django
> book.
> In
> https://docs.djangoproject.com/en/1.11/topics/http/views/
> there is this view function:
> def current_datetime(request):
>     now = datetime.datetime.now()
>     html = "<html><body>It is now %s.</body></html>" % now
>     return HttpResponse(html)
>
> and in:
> http://djangobook.com/django-views-dynamic-content/http://
> djangobook.com/django-views-dynamic-content/
> there is this view function:
> def hours_ahead(request, offset):
>     try:
>         offset = int(offset)
>     except ValueError:
>         raise Http404()
>     dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
>     html = "In %s hour(s), it will be  %s." % (offset, dt)
>     return HttpResponse(html)
>
> So in the view function I can pass *request* as well as an *argument*
> from the url but how does the signature of a view function look like?
> Where can I find it in the documentation?
> Is it possible to see such signatures in PyCharm?
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/76227b4e-5de3-4ca1-a9c6-658c2ee69529%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/76227b4e-5de3-4ca1-a9c6-658c2ee69529%40googlegroups.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 [email protected].
To post to this group, send email to [email protected].
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/CAH-droyZRQNwUA39G7y9fgcodtFoO_pn1OTgO0s1ANDsn0pRtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to