Installation of django

2019-08-20 Thread Amit Samanta
Hi,

I want to install django in linux server for python 2.7.2.
i am not able install django
Please help with the installation step for django in linux.


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/1972eeeb-da5d-4146-94a6-5ba8551a92ea%40googlegroups.com.


Django with mysql

2019-08-23 Thread Amit Samanta
Hi,

I am facing issue while downloading *mysql client*
Here i am using linux server and i do not have internet connection
Also downloaded all the packages from *https://www.pypi.org*
We have created user,password and database for django in a different mysql 
server 5.6

Things i have done:
First of all i do not have internet connection in linux server where i have 
installed django


i am using python 3.6.8
django 1.11
 dependencies -> pytz
->sqlparse

then i started the server and it started.
installed python3-devel and mysql-devel from rhel repo

Then installed through pip3 install mysql-connector-python.whl
dependencies -> protobuf >=3.0.0
   ->six >=1.9

from setting.py
I configured the databases

tried to runserver
ERROR:mysqldb console

Now found no mysql client
thought install *mysql client 5.6* from os level but no luck

got mysql client 1.4.4 in pypi but all in windows os

googled and search many site but everywhere it is "pip install mysql 
client" but no internet.

Please help! As now the goal is change django from sqllite3 to mysql.


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/bb37fac6-f9a7-4c1b-b563-a7557222b6a4%40googlegroups.com.


Re: Django with mysql

2019-08-23 Thread Amit Samanta
On Friday, August 23, 2019 at 8:25:47 PM UTC+5:30, Amit Samanta wrote:
> Hi,
> 
> 
> I am facing issue while downloading mysql client
> Here i am using linux server and i do not have internet connection
> Also downloaded all the packages from https://www.pypi.org
> We have created user,password and database for django in a different mysql 
> server 5.6
> 
> 
> Things i have done:
> First of all i do not have internet connection in linux server where i have 
> installed django
> 
> 
> 
> 
> i am using python 3.6.8
> django 1.11
>  dependencies -> pytz
>                         ->sqlparse
> 
> 
> then i started the server and it started.
> installed python3-devel and mysql-devel from rhel repo
> 
> 
> Then installed through pip3 install mysql-connector-python.whl
> dependencies -> protobuf >=3.0.0
>                        ->six >=1.9
> 
> 
> from setting.py
> I configured the databases
> 
> 
> tried to runserver
> ERROR:mysqldb console
> 
> 
> Now found no mysql client
> thought install mysql client 5.6 from os level but no luck
> 
> 
> got mysql client 1.4.4 in pypi but all in windows os
> 
> 
> googled and search many site but everywhere it is "pip install mysql client" 
> but no internet.
> 
> 
> Please help! As now the goal is change django from sqllite3 to mysql.
> 
> 
> 
> 
> Thanks and Regards
> Amit Samanta

@Gobo Lato
Sir with searching mysqlclient all are for windows not in linux

@khalifa gueye
sir where can i get the version? pypi?

@Ahlam
sir i am working on my office network that is the issue.


i have tried pymysql it worked xan anyone help me with the differents between 
pymysql and mysqlclient

-- 
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/72e3d542-1877-44f4-b7ab-8f40c0c14848%40googlegroups.com.


Please help me in views.py

2019-09-03 Thread Amit Samanta
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.


Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
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.


Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
now how can i get the name for author and details??

On Wed, 4 Sep, 2019, 10:25 AM 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/CAP4hbAY%3DvOB%2BEs6hZ77jcAU_-LuuG51LkqEPU3eB5nrgqS48ow%40mail.gmail.com.


Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
i just need the veiw.py after this done i will try your tutorial

On Wed, 4 Sep, 2019, 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, 
>> 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/CAP4hbAY%3DvOB%2BEs6hZ77jcAU_-LuuG51LkqEPU3eB5nrgqS48ow%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAP4hbAY%3DvOB%2BEs6hZ77jcAU_-LuuG51LkqEPU3eB5nrgqS48ow%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/CAPcVkjg11EAf-rYFvoz85Y5BLKBisD4FJQSOCzonzi0TFC91ZQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPcVkjg11EAf-rYFvoz85Y5BLKBisD4FJQSOCzonzi0TFC91ZQ%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/CAP4hbAbE21Cz1rfPohvhUbZ6DRO_5QHQTdVDZWotOU%3DjkjioDA%40mail.gmail.com.


Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
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, 
>>> 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
>>

Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
by the above it is not giving any error but it is not showing the
correspondence names and also it is showing all the fields in detail :-((

please help

On Wed, 4 Sep, 2019, 4:10 PM 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) ...
>>>>>>>
>>>>&g

Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
i get all thank you for your help..
the actuall funda is
i have to show author name with related to that i have to show books name
of the same author now the detail related to the books
this is wht i need
:-(

On Wed, 4 Sep, 2019, 6:01 PM 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.

Re: Please help me in views.py

2019-09-04 Thread Amit Samanta
Its done now.. thank u everybody

Now i want to do that it will show only the latest book with detail of a
author



On Wed, 4 Sep, 2019, 6:07 PM Amit Samanta,  wrote:

> i get all thank you for your help..
> the actuall funda is
> i have to show author name with related to that i have to show books name
> of the same author now the detail related to the books
> this is wht i need
> :-(
>
> On Wed, 4 Sep, 2019, 6:01 PM 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.googl

Re: Please help me in views.py

2019-09-05 Thread Amit Samanta
Hi everybody thank you for helping me throughout...

lastly do anyone know how to group by in django orm


 or if i give a db query can anyone help me in changing it to django orm??
please
Thank you in advance
Amit Samanta

On Wed, 4 Sep, 2019, 7:50 PM Amit Samanta,  wrote:

> Its done now.. thank u everybody
>
> Now i want to do that it will show only the latest book with detail of a
> author
>
>
>
> On Wed, 4 Sep, 2019, 6:07 PM Amit Samanta, 
> wrote:
>
>> i get all thank you for your help..
>> the actuall funda is
>> i have to show author name with related to that i have to show books name
>> of the same author now the detail related to the books
>> this is wht i need
>> :-(
>>
>> On Wed, 4 Sep, 2019, 6:01 PM 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/djang

Query into Django ORM

2019-09-05 Thread Amit Samanta
Hi,

I am facing a challenge please help me.

[image: Query.PNG]


output:

[image: output.PNG]

Here one env_name can have many comp name and one env with one comp_name 
there will be many deploy_details which is in green colour (latest).

in deploy_detail if there is two deploy in one component we will take the 
latest deploy_date. 


Now please can anyone help me in converting this query into Django ORM and 
the models 

Thanks in advance



-- 
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/db10af4c-ef4c-47cb-82fd-a442d3b381ab%40googlegroups.com.


Django ORM

2019-09-09 Thread Amit Samanta
Hi,

Please help
 i have models

[image: Capture.JPG]

here

there will be env under which there will be deployment to many component 
and also i component multiple times

now i want a output like 

(env name   - (component (recent updated in detail table)
deploy_dtls according to the recent component )per component)per environment


Please please 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/fd1e5153-0908-4753-a2d2-b8e6b660d4bb%40googlegroups.com.