Re: Please help me in views.py

2019-09-04 Thread Devdutt Bhati
wiil get resolve the issue revert me.

On Wed, Sep 4, 2019 at 1:07 AM Devdutt Bhati 
wrote:

> if you created table in models.py. you can import table at view file like
> : from  appname .models import table/class name .
> when you got the table data at views file then use it as
> *variable=Tablename.objects.all()* now get all values in variable. it can
> render in render function and use values at html page.
> use for loop.
>
> On Wed, Sep 4, 2019 at 12:58 AM Amit Samanta 
> wrote:
>
>> I want try is...
>> there will be a dashboard
>>
>> which will show
>>
>> Author name
>>
>> all the books which the author written
>>
>> details of the book published date , avout the book in the above format
>>
>>
>> On Wed, 4 Sep, 2019, 12:08 PM Anirudh Jain, 
>> wrote:
>>
>>> Could you please elaborate/be more clear about what you are really
>>> trying to do ?
>>>
>>> On Wed, 4 Sep 2019, 10:26 Bhoopesh sisoudiya, 
>>> wrote:
>>>
>>>> Hi Amit,
>>>>
>>>> You can use
>>>> =≠=
>>>> Book.objects.select_related(FK).select_related(FK). values (select
>>>> column name which you want).all()
>>>>
>>>>
>>>> Thanks
>>>> Bhoopesh sisoudiya
>>>>
>>>> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I need help i am not understanding the keywords of joining and fetch
>>>>> value in veiw.py
>>>>> i have three tables in model.py
>>>>>
>>>>> Table 1(Author) :
>>>>>
>>>>> Table 2(books):
>>>>>
>>>>> Table 3 (details):
>>>>> FK of table1
>>>>> FK of table2
>>>>>
>>>>> Fk = foreign key
>>>>>
>>>>> I have to just show
>>>>>
>>>>> Author (author name) Books (dynamic) Books(author 2nd book)
>>>>>...
>>>>> details(dynamic)
>>>>>  details(dtl of author 2nd book) ...
>>>>>
>>>>> I have created the template
>>>>>
>>>>> now in views.py i an confused
>>>>>
>>>>> book=books.object(i do not get what to do)
>>>>> Author= (same )
>>>>> details = (same)
>>>>>
>>>>> Please can anybody help that will be very greatfull.
>>>>> Thank you in advance
>>>>>
>>>>>
>>>>>
>>>>> Thanks and Regards
>>>>> Amit Samanta
>>>>>
>>>>> --
>>>>> 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/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/54483cc3-eadd-4559-8c61-c179cfbab933%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/CAAk3c1OzGXKSQg8GK1C8_5Ck-iQ%2B1WjsYMdD%2B%2B0_q3inb94jyw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAAk3c1OzGXKSQg8GK1C8_5Ck-iQ%2B1WjsYMdD%2B%2B0_q3inb94jyw%40mail.gmail.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/CAC3mK7faT1yOHZXdHXc0DyeDYRtTpD_Pke39AJYmXRQW%2BOi09Q%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAC3mK7faT1yOHZXdHXc0DyeDYRtTpD_Pke39AJYmXRQW%2BOi09Q%40mail.gmail.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/CAP4hbAbWFvE0CRoeX45psThD7yWbKHR16aJXH866-dCFdHSfZw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAP4hbAbWFvE0CRoeX45psThD7yWbKHR16aJXH866-dCFdHSfZw%40mail.gmail.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/CAP1z-%3DK%2B2htPjgzrmY8Gqr-OZF3bWcRei6V0axqAOpYd-Y2XVA%40mail.gmail.com.


Re: Please help me in views.py

2019-09-04 Thread Devdutt Bhati
def getdetails(request11):
 objs = Details.objects.all()
 context = {'objs; : objs}
return render(request, 'full_path_of_template', context}

templates in which folders path should set in setting file. try this all
the best and revert me.
view.py :-
def getdetails(request):
template_name = 'showDetails.html'
objs = Details.objects.all()
context = {'objs; : objs}
return render(request, template_name, context}


On Wed, Sep 4, 2019 at 3:40 AM Anirudh Jain 
wrote:

> Then simply use {{ obj.book_name.name }} in template where again, I am
> assuming 'name' is the column name you have give to book name in Books model
>
> On Wed, Sep 4, 2019 at 3:25 PM Amit Samanta 
> wrote:
>
>> You have gussed correctly..
>> but i have taked book id as fk but i need the book name
>>
>> On Wed, 4 Sep, 2019, 2:41 PM Anirudh Jain, 
>> wrote:
>>
>>> This can be done easily if you make a proper view function and render
>>> data from it in template properly.
>>> A view function can be written like this :-
>>>
>>> Here I am assuming that you want get the details of all the
>>> books/auuthors at one page. If you want details of a particular book, then
>>> the following function will be different.
>>>
>>> from .models import Details, Author, Books
>>> from django.shortcuts import render
>>>
>>> view.py :-
>>> def getdetails(request):
>>> template_name = 'showDetails.html'
>>> objs = Details.objects.all()
>>> context = {'objs; : objs}
>>> return render(request, template_name, context}
>>>
>>>
>>> showDetails.html :-
>>> (use this block in your html code wherever you want to show this data)
>>>
>>> {% if objs %}
>>>
>>> 
>>> 
>>> Author
>>> Book
>>> 
>>>
>>> {% for obj in objs %}
>>> 
>>>   {{ obj.author_name }} 
>>>   {{ obj.book_name }} 
>>> 
>>> {% endfor %}
>>> 
>>>
>>> {% endif %}
>>>
>>> (In above html code, I have assumed that author_name and book_name are
>>> the FK in your Details table. Also, I am not sure
>>>
>>>
>>> On Wed, Sep 4, 2019 at 1:34 PM Lim Kai Wey  wrote:
>>>
 Hey Amit,

 I suggest you to follow this tutorial to build your project,

 https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website

 It teaches you all the basics that you need to know from scratch, which
 in my opinion will answer all the questions you're asking.
 The tutorial is about building a local library webpage which I believe
 is very similar to what you are doing now.

 Hope this helps.

 Regards,
 Kai Wey

 On Wed, Sep 4, 2019 at 3:59 PM Amit Samanta 
 wrote:

> now how can i get the name for author and details??
>
> On Wed, 4 Sep, 2019, 10:25 AM Bhoopesh sisoudiya, <
> bhoop23...@gmail.com> wrote:
>
>> Hi Amit,
>>
>> You can use
>> =≠=
>> Book.objects.select_related(FK).select_related(FK). values (select
>> column name which you want).all()
>>
>>
>> Thanks
>> Bhoopesh sisoudiya
>>
>> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta 
>> wrote:
>>
>>> Hi,
>>>
>>> I need help i am not understanding the keywords of joining and fetch
>>> value in veiw.py
>>> i have three tables in model.py
>>>
>>> Table 1(Author) :
>>>
>>> Table 2(books):
>>>
>>> Table 3 (details):
>>> FK of table1
>>> FK of table2
>>>
>>> Fk = foreign key
>>>
>>> I have to just show
>>>
>>> Author (author name) Books (dynamic) Books(author 2nd book)
>>>  ...
>>> details(dynamic)
>>>  details(dtl of author 2nd book) ...
>>>
>>> I have created the template
>>>
>>> now in views.py i an confused
>>>
>>> book=books.object(i do not get what to do)
>>> Author= (same )
>>> details = (same)
>>>
>>> Please can anybody help that will be very greatfull.
>>> Thank you in advance
>>>
>>>
>>>
>>> Thanks and Regards
>>> Amit Samanta
>>>
>>> --
>>> 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/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/djang

Re: Please help me in views.py

2019-09-04 Thread Devdutt Bhati
if you created table in models.py. you can import table at view file
like : from
appname .models import table/class name .
when you got the table data at views file then use it as
*variable=Tablename.objects.all()* now get all values in variable. it can
render in render function and use values at html page.
use for loop.

On Wed, Sep 4, 2019 at 12:58 AM Amit Samanta 
wrote:

> I want try is...
> there will be a dashboard
>
> which will show
>
> Author name
>
> all the books which the author written
>
> details of the book published date , avout the book in the above format
>
>
> On Wed, 4 Sep, 2019, 12:08 PM Anirudh Jain, 
> wrote:
>
>> Could you please elaborate/be more clear about what you are really trying
>> to do ?
>>
>> On Wed, 4 Sep 2019, 10:26 Bhoopesh sisoudiya, 
>> wrote:
>>
>>> Hi Amit,
>>>
>>> You can use
>>> =≠=
>>> Book.objects.select_related(FK).select_related(FK). values (select
>>> column name which you want).all()
>>>
>>>
>>> Thanks
>>> Bhoopesh sisoudiya
>>>
>>> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta 
>>> wrote:
>>>
 Hi,

 I need help i am not understanding the keywords of joining and fetch
 value in veiw.py
 i have three tables in model.py

 Table 1(Author) :

 Table 2(books):

 Table 3 (details):
 FK of table1
 FK of table2

 Fk = foreign key

 I have to just show

 Author (author name) Books (dynamic) Books(author 2nd book)
...
 details(dynamic)
  details(dtl of author 2nd book) ...

 I have created the template

 now in views.py i an confused

 book=books.object(i do not get what to do)
 Author= (same )
 details = (same)

 Please can anybody help that will be very greatfull.
 Thank you in advance



 Thanks and Regards
 Amit Samanta

 --
 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/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com
 
 .

>>> --
>>> 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/CAAk3c1OzGXKSQg8GK1C8_5Ck-iQ%2B1WjsYMdD%2B%2B0_q3inb94jyw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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/CAC3mK7faT1yOHZXdHXc0DyeDYRtTpD_Pke39AJYmXRQW%2BOi09Q%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAP4hbAbWFvE0CRoeX45psThD7yWbKHR16aJXH866-dCFdHSfZw%40mail.gmail.com
> 
> .
>

-- 
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/CAP1z-%3DLZqkq38wgz7w%2Bv%2BuzWcWkJsx1xUr-kdkpOGTKgBuwOQA%40mail.gmail.com.


Re: Python +django

2019-09-08 Thread Devdutt Bhati
https://www.youtube.com/watch?v=q6qE_uJB59c&list=PLd3UqWTnYXOnkicyzePnIg8rc2qEXgjiF

learn this videos first and after learn django get some knowledge  about
python.


I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Sep 8, 2019 at 11:08 AM kemo0 king  wrote:

> I am new on programming  ,to be a programmer and getting the ability to
> create a web program that is one of my dreams , I have started   with
> python  I know little about html and css and js now I want to learn django
> am I on the right  way what should I learn before diving in django  I need
> ur help
>
> --
> 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/69cfa675-0023-464b-a4ad-080f4c59db4d%40googlegroups.com
> 
> .
>

-- 
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/CAP1z-%3D%2B_h0x%3D_YvjFukMZ%3Dd7REROhONCw3Rv6cb9FdffdN%2B1Fg%40mail.gmail.com.