Re: How to get names of columns from QuerySet without executing it

2020-07-04 Thread Eugene Kulak
The closes I can get with this is the following: comp = queryset.query.get_compiler(DEFAULT_DB_ALIAS) fields = [alias or sql.split('.')[1] for _, (sql, _), alias in comp.get_select()[0]] On Saturday, July 4, 2020 at 4:11:41 PM UTC-4, Eugene Kulak wrote: > > How to get names of columns from

Django

2020-07-04 Thread Exactly musty
Are you serious from scratch?don't you read the documentation -- 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

Re: How to get names of columns from QuerySet without executing it

2020-07-04 Thread Eugene Kulak
I think reading the question first and answer only when you have anything to say is even better? On Saturday, July 4, 2020 at 5:08:04 PM UTC-4, Vishesh Mangla wrote: > > I think learning some sql commands would be good. Lots of youtube tuts > available online. >

Re: How to get names of columns from QuerySet without executing it

2020-07-04 Thread Eugene Kulak
Thank you, Stephen, but this is not what I asked. I can't change QuerySet and I don't know how it looks like. On Saturday, July 4, 2020 at 4:30:40 PM UTC-4, Akinfolarin Stephen wrote: > > you can filter out the column you want by using > [name of model].objects.get(filter=[name of the column

Re: How to get names of columns from QuerySet without executing it

2020-07-04 Thread Vishesh Mangla
I think learning some sql commands would be good. Lots of youtube tuts available online. https://docs.djangoproject.com/en/3.0/topics/db/sql/#executing-custom-sql-directly On Sun, Jul 5, 2020 at 1:59 AM Akinfolarin Stephen < akinfolarinsteph...@gmail.com> wrote: > you can filter out the column

Django

2020-07-04 Thread Tanni Seriki
Please can someone leature me on how to get post details using slug... From scratch, am confused. Help a brother out please. Please!!! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: How to get names of columns from QuerySet without executing it

2020-07-04 Thread Akinfolarin Stephen
you can filter out the column you want by using [name of model].objects.get(filter=[name of the column you want]) On Sun, Jul 5, 2020 at 10:12 AM Eugene Kulak wrote: > How to get names of columns from QuerySet without executing it? > If it is not possible what would be the most easier way to

How to get names of columns from QuerySet without executing it

2020-07-04 Thread Eugene Kulak
How to get names of columns from QuerySet without executing it? If it is not possible what would be the most easier way to execute a lighter version of the query. The query itself is unknown, it could be anything. -- You received this message because you are subscribed to the Google Groups

Re: Need Covid 19 Database for Experiments

2020-07-04 Thread Aldian Fazrihady
There are covid-19 datasets in Google Cloud Platform ready to be queried. You can go to https://console.cloud.google.com/bigquery and immediately execute a covid-19 related query, for example: ``` SELECT * FROM `bigquery-public-data.covid19_ecdc.covid_19_geographic_distribution_worldwide` WHERE

Re: Custom-DRF-Response

2020-07-04 Thread Karthik Marudhanayagam
Hi, please refer https://stackoverflow.com/questions/47173483/django-rest-framework-custom-format-for-all-out-responses hope this helps. Best Karthik On Sat, Jul 4, 2020 at 5:30 PM Ronaldo Mata wrote: > Thx for your answer.  > > but this brings me to the second point. If I do that I must to

Re: Custom-DRF-Response

2020-07-04 Thread Ronaldo Mata
I Think that this should be a common approach, since many famous frontend framework is easier to create logic to deal with that format response. El sáb., 4 jul. 2020 a las 10:00, Ronaldo Mata () escribió: > I think that this not depend of my serializer. I only want that the > response data will

Re: Custom-DRF-Response

2020-07-04 Thread Ronaldo Mata
I think that this not depend of my serializer. I only want that the response data will be inside data variable in the JSON response and i need to add status variable and message to the JSON response. I can to rewrite all Class Based Views of DRF to response with my desired format. but this sound

One field form - do i need Form class

2020-07-04 Thread Jan Gregorczyk
I want to have search form with just one field. Should I use Form class or is it overkill? -- 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

Re: Custom-DRF-Response

2020-07-04 Thread Julio Cojom
How is your model and your serializer? El sáb., 4 jul. 2020 a las 6:00, Ronaldo Mata () escribió: > Thx for your answer.  > > but this brings me to the second point. If I do that I must to rewrite all > method in my API Class Based Views to response with this format. I think > that is not the

Re: Custom-DRF-Response

2020-07-04 Thread Ronaldo Mata
Thx for your answer.  but this brings me to the second point. If I do that I must to rewrite all method in my API Class Based Views to response with this format. I think that is not the best way to deal with this problem. What do you think? El sáb., 4 jul. 2020 a las 7:53, Arpana Mehta ()

Re: Custom-DRF-Response

2020-07-04 Thread Arpana Mehta
You can use a function which returns Response({'status': 'SUCCESS'}) On Sat, 4 Jul 2020, 03:24 Ronaldo Mata, wrote: > Hi Guys > > Somebody can help me? > > I want to create a custom response with the follow format: > > { > "status": true, > "message": "Any message", > "data": []} > > >

Unable to export images from django model to excel sheet

2020-07-04 Thread Ashutosh Mishra
I have posted on stack overflow.I want export images from django model to excel sheet.while doing I am just getting the root media address on excel sheet not image. Please help ,it's urgent.

Re: Django how get Post details using slug

2020-07-04 Thread arman hossain
please try On Sat, Jul 4, 2020 at 9:38 AM Tanni Seriki wrote: > Thanks sir, I will make changes. > I really appreciate your time and effort in helping me out with this > Thanks > > On Fri, Jul 3, 2020, 11:14 PM coolguy > wrote: > >> One more thing. if your view code is indented exactly the way

Re: Need Covid 19 Database for Experiments

2020-07-04 Thread Luciano Martins
Hello, you have an excellent job done by devs and Brazilian journalists... https://brasil.io/covid19/ Em quinta-feira, 2 de julho de 2020 14:38:51 UTC-3, Balaji escreveu: > > Hi > > Can anyone provide me Covid 19 Database. > I need Covid 19 Database for Experiments > > Thank you > > > -- > Mr

Re: Unable to modify Session with signed_cookies backend

2020-07-04 Thread Krishna Chaitanya
Hi, Thanks. I know how to isntallle using pip but pip isn't installed in our devices, and moreover there is no difference in the code with layers version. On Sat, 4 Jul, 2020, 8:04 am Ogunsanya Opeyemi, wrote: > > Hi, > Serach for pip install url on ubuntu then you for you to get pip