Re: View Function Signature?

2017-05-14 Thread Nick Gilmour
> > Neither one of these is what was being asked for. I didn't say I have found what I was looking for. All answers are sufficient to me for now. Thanks. On Sun, May 14, 2017 at 10:51 PM, James Bennett wrote: > On Sun, May 14, 2017 at 1:36 PM, Nick Gilmour

Re: View Function Signature?

2017-05-14 Thread James Bennett
On Sun, May 14, 2017 at 1:36 PM, Nick Gilmour wrote: > Definition of url: > > *def url(regex, view, kwargs=None, name=None):* > > I also found this: > *def view(request, *args, **kwargs):* > > Neither one of these is what was being asked for. And like several people have

Re: View Function Signature?

2017-05-14 Thread Nick Gilmour
Definition of url: *def url(regex, view, kwargs=None, name=None):* I also found this: *def view(request, *args, **kwargs):* here: *.../django/views/generic/base.py* On Sat, May 13, 2017 at 11:15 PM, Daniel Roseman wrote: > On Friday, 12 May 2017 15:11:55 UTC+1,

Re: View Function Signature?

2017-05-13 Thread Daniel Roseman
On Friday, 12 May 2017 15:11:55 UTC+1, nickeforos wrote: > > 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

Re: View Function Signature?

2017-05-12 Thread Constantine Covtushenko
Hi Nick, As for me it is responsibility of the developer to define view function. There is only one mandatory argument 'request'. All other are based on the logic of view function and url patterns. Say for view function that operates with entity might be natural to add 'id' as a second

Re: View Function Signature?

2017-05-12 Thread Nick Gilmour
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

Re: View Function Signature?

2017-05-12 Thread Constantine Covtushenko
Hi, Please check that link of documentation. For me it was very helpful to understand all pieces of Request/Response cycle. Regards, Constantine C. On Fri, May 12, 2017 at 4:05 PM, nickeforos

View Function Signature?

2017-05-12 Thread nickeforos
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 = "It is now %s." % now return