Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Lalit Suthar
Fabio C. Barrionuevo da Luz's answer will work like a charm! On Fri, 21 Jan 2022 at 21:04, Fabio C. Barrionuevo da Luz wrote: > this can be easily solved by using an annotation to calculate the > difference and store it in a new temporary column, and then sort by it > > > from django.db.models

Django and google maps

2022-01-21 Thread Oumar Thiombane
how to integrate and add locality data in a map??? HELP ME 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 from it, send an email to django-users+unsubscr...@googlegroups.com. To v

NotImplementedError: Database objects do not implement truth value testing or bool(). Please compare with None instead: database is not None

2022-01-21 Thread Oumar Thiombane
NotImplementedError: Database objects do not implement truth value testing or bool(). Please compare with None instead: database is not None -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving email

Re: error email in django

2022-01-21 Thread Saad Olamilekan
Maybe I didn't get the question better, but if what am thinking, like if you want to be using email login to your app instead of username think you have to do so Check the link to know if your question tally to my answer. https://www.django-rest-framework.org/tutorial/1-serialization/ On Sat, Jan

Re: error email in django

2022-01-21 Thread Richard Myers
Get Outlook for iOS From: django-users@googlegroups.com on behalf of Aksh Desai Sent: Friday, January 21, 2022 2:06 PM To: django-users@googlegroups.com Subject: Re: error email in django ok My problem is solved in django email. Thank yo

RE: Models

2022-01-21 Thread Mike Dewhirst
Not safely. You would need to script everything behind the scenes - including migration.A safer approach might be to use a generic table which contains the necessary meta information (char, int etc) as data alongside the actual data in each row. I would also consider booking sessions with a psyc

Re: Search & replace an object in the database

2022-01-21 Thread Thomas Lockhart
Yes this exactly. A couple of possible additions: I’ve had great luck using python and SQL queries to manipulate a database including converting from other schemas and merging duplicate records. Make a test database from your backup, and beat it up with your scripted code until you are happy wi

Re: Search & replace an object in the database

2022-01-21 Thread Bernard Mallala
I would approach this differently and from the database side mostly 1. Backup the database so you can restore if something happens 2. In Django, Create an an empty copy of the Customer database e.g CustomerB 3. Using a SQL query tool, select all duplicate copies from Customer and

Re: Search & replace an object in the database

2022-01-21 Thread Yeboah Dominic
Okay bro try this script hope it works On Fri, 21 Jan 2022 at 10:05, jools wrote: > Dear Django users, > > here’s an interesting case and I’m curious whether somebody can point me > in the right direction. > > Here’s the problem: > My company has a database of customers. Over the years, many dup

Re: Django works with PDF

2022-01-21 Thread gpjhostavie bouala
hello please help on how to download and install django Le ven. 21 janv. 2022 à 14:50, Gabriel Araya Garcia < gabrielaraya2...@gmail.com> a écrit : > Hola, > No entiendo lo que es 'metadatos', pero es bastante conocida la > librería REPORTLAB, y yo la he implementado en mis proyectos, es > relat

Models

2022-01-21 Thread Prashanth Patelc
Dear Django users, I need some information regarding Django models, I would like to know is there any way to create Django models through frontend or can we create models by super admin. Kindly share any tutorials or any examples available. Example: we are create models in django like below

Re: Search & replace an object in the database

2022-01-21 Thread jools
Here’s an update: I sticked to the idea of using collector; it categorizes models from a deletion perspective into: - fast_deletes - models that can be easily deleted, without checking for other relations - update_fields - field that have SET_NULL, i.e. relations to the customer ob

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Fabio C. Barrionuevo da Luz
this can be easily solved by using an annotation to calculate the difference and store it in a new temporary column, and then sort by it from django.db.models import F from myapp.models import ExampleModel queryset = ExampleModel.objects.annotate( dt_difference=F('updated_at') - F('created_a

Re: How to send data from views.py to index.html

2022-01-21 Thread Lakshyaraj Dash X-D 25
You can send the data through a dictionary or you can use json response and fetch the json response through javascript. On Fri, Jan 21, 2022, 20:35 Kabir wrote: > How to we use views.py to send data to index.html? > > On Thursday, January 20, 2022 at 11:59:17 AM UTC+5:30 Leo guitar girl > wrote:

Search & replace an object in the database

2022-01-21 Thread jools
Dear Django users, here’s an interesting case and I’m curious whether somebody can point me in the right direction. Here’s the problem: My company has a database of customers. Over the years, many duplicates have been created. For cleaning up duplicates, I’d like to have a search-and-replace f

How to send data from views.py to index.html

2022-01-21 Thread Kabir
How to we use views.py to send data to index.html? On Thursday, January 20, 2022 at 11:59:17 AM UTC+5:30 Leo guitar girl wrote: > I have sent you an invitation > > On Wed, Jan 19, 2022 at 9:54 AM Vkash Poudel wrote: > >> can we connect via email so that i can share my codes regarding Time >> ba

Re: Order_by on the basis of time difference:

2022-01-21 Thread Erlan Abdraimov
i can user django user Aadil Rashid , 21 Oca 2022 Cum, 07:35 tarihinde şunu yazdı: > class UserModel(models.Model): > is_active = models.BooleanField(default=True) > created_at = models.DateTimeField(auto_now_add=True) > updated_at = models.DateTimeField(auto_now=True) > > > > I want to query on

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Gabriel Araya Garcia
Try this: ExampleModel.objects.all().order_by('updated_at' , '-created_at') Gabriel Araya Garcia GMI - Desarrollo de Sistemas Informáticos El vie, 21 ene 2022 a las 1:54, Aadil Rashid () escribió: > class ExampleModel(models.Model): > is_active = models.BooleanField(default=True) > created_at

Re: Django works with PDF

2022-01-21 Thread Gabriel Araya Garcia
Hola, No entiendo lo que es 'metadatos', pero es bastante conocida la librería REPORTLAB, y yo la he implementado en mis proyectos, es relativamente fácil lograr lo que tu quieres con ella. Si aún no has resuelto tu problema escribeme y te mandare unos ejemplos. Ademas hay lot of sites que muestra

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Feroz Ahmed
Hi, in VIEWS def example=(request): fm=ExampleModel.object.created_at ExMd=ExampleModel.objects.filter(created_at__lt={'fm'})... ordering conditions. On Friday, January 21, 2022 at 10:25:13 AM UTC+5:30 aadil1...@gmail.com wrote: > class ExampleModel(models.Model): > is_active =

Re: error email in django

2022-01-21 Thread Aksh Desai
ok My problem is solved in django email. Thank you On Fri, 21 Jan 2022 at 18:14, Kasper Laudrup wrote: > On 21/01/2022 00.37, Saad Olamilekan wrote: > > Have you install rest frame work then, insert it to register app in > setting? > > > > No. Why would I want to do that? > > Are you sure you me

Re: error email in django

2022-01-21 Thread Kasper Laudrup
On 21/01/2022 00.37, Saad Olamilekan wrote: Have you install rest frame work then, insert it to register app in setting? No. Why would I want to do that? Are you sure you meant to reply to me? Kind regards, Kasper Laudrup -- You received this message because you are subscribed to the Googl

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Aadil Rashid
This is nice idea, but I can't change the model, as discussed by teammates, i need to figure out any other way to do it on the go. On Fri, Jan 21, 2022 at 5:02 PM Lalit Suthar wrote: > won't be possible like this, It will be easy if you have another entry in > models which stores the difference

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Lalit Suthar
won't be possible like this, It will be easy if you have another entry in models which stores the difference between updated and created. You can update that field whenever an object is updated. And then can run order_by on that field directly On Fri, 21 Jan 2022 at 10:24, Aadil Rashid wrote: >