Re: How this Line of code works

2019-04-16 Thread Milind Thombre
hi Mayur, What does this application do? Milind On Tue, Apr 16, 2019 at 10:16 AM Mayur Bagul wrote: > hello jani, > > thanks for hep. i read django doc and this is the example from it but > there is no information provided for why these parameters are used. > but thanks for your information it

Re: How this Line of code works

2019-04-15 Thread Mayur Bagul
hello jani, thanks for hep. i read django doc and this is the example from it but there is no information provided for why these parameters are used. but thanks for your information it is useful like others gave me. thanking you. On Monday, April 15, 2019 at 11:59:51 AM UTC+5:30, Jani Tiainen

Re: How this Line of code works

2019-04-15 Thread Jani Tiainen
Hi. get_object_or_404 works so that first argument is the model class you want to query. Rest of the parameters are filters that mus return a single object. You can find this information from the Django docs as well. ma 15. huhtik. 2019 klo 7.23 Mayur Bagul kirjoitti: > how passing Question

Re: How this Line of code works

2019-04-14 Thread Mayur Bagul
how passing Question and pk=question_id gonna help? On Sunday, April 14, 2019 at 5:41:06 PM UTC+5:30, gulam rabbani wrote: > > It will give you to fetch the id ! Until end of the id > > On Sun, 14 Apr, 2019 at 1:47 PM, Mayur Bagul > wrote: > >> In below code i didnt understand how colored line

Re: How this Line of code works

2019-04-14 Thread Mayur Bagul
Hello vineeth, thanks for information. u missed to mention about why we passing Question class and primary key in get_object_or_404() ? How passing such arguments gonna work? On Sunday, April 14, 2019 at 1:25:13 PM UTC+5:30, vineeth sagar wrote: > > Hi Mayur, > > get_object_or_404, returns an

Re: How this Line of code works

2019-04-14 Thread gulam rabbani
It will give you to fetch the id ! Until end of the id On Sun, 14 Apr, 2019 at 1:47 PM, Mayur Bagul wrote: > In below code i didnt understand how colored line of code is working with > template code ? > > why we are passing Question and primary key? instead of dictionary to > context variable.

Re: How this Line of code works

2019-04-14 Thread vineeth sagar
Hi Mayur, get_object_or_404, returns an object if it exists in the database or it will raise a 404 exception. So if the object is in the DB, django render template is done, in your case detail.html is rendered with the context dictionary.If there's no row peertaining to the query, then Http404

How this Line of code works

2019-04-14 Thread Mayur Bagul
In below code i didnt understand how colored line of code is working with template code ? why we are passing Question and primary key? instead of dictionary to context variable. plz help me to get out of this confusion. thanking you. *view.py* from django.shortcuts import