Re: Suggestion for prefetch_related() documentation

2022-06-23 Thread Jason
This is explicitly called out in the documentation at https://docs.djangoproject.com/en/4.0/topics/db/optimization/#understand-queryset-evaluation On Thursday, June 23, 2022 at 1:17:50 PM UTC-4 laurent...@gmail.com wrote: > Hello, > > I made a simple test to check the number of queries done : >

Suggestion for prefetch_related() documentation

2022-06-23 Thread Laurent Lyaudet
Hello, I made a simple test to check the number of queries done : # First part order = Order.objects.get(id=2) # one query items = list(order.items.all()) # one query items = list(order.items.all()) # one query items = list(order.items.all()) # one query # Second part order = Order.objec

Timeout error in send_mail function

2022-06-23 Thread Sona Sivasundari
Hi. I'm working on a project with django and django rest framework. In one of my views, I tried implementing a simple send_mail, but it gives me a TimeOut error. I configured the settings (Email backend as smtp, email host, password, ...), and also alowed my email to accept 'less secured apps',

Code produced by "django-admin startproject" isn't formatted by black

2022-06-23 Thread Paweł Adamczak
Hi! I just run "django-admin startproject" command on the latest Django version (4.0.5) and noticed that the code it generated isn't formatted by black, even though #33476 explicitly mentions that it should. I wasn't sure if I should open another b

Re: Django could not parse the remainder

2022-06-23 Thread Shaheed Haque
>From memory, At least in Jinja templates, you can explicitly use the dictionary form {{ key["hypen-ated"] }}... Have you tried that? On Thu, 23 Jun 2022, 14:44 Ryan Nowakowski, wrote: > > https://stackoverflow.com/questions/8252387/how-do-i-access-dictionary-keys-that-contain-hyphens-from-withi

Re: Django could not parse the remainder

2022-06-23 Thread Lakshyaraj Dash XI-D 25
You can have a template filter that can parse your dictionary. On Thu, Jun 23, 2022, 19:14 Ryan Nowakowski wrote: > > https://stackoverflow.com/questions/8252387/how-do-i-access-dictionary-keys-that-contain-hyphens-from-within-a-django-templa > > On Mon, Jun 20, 2022 at 07:52:46AM -0700, Koushik

ERROR : no such table

2022-06-23 Thread Hugh Frost
Good evening all, I'm working on django 3.2 project, i have one issue with migrations. my project already in live. same time I'm adding two new tables in same file but that was in local, now i'm trying to add live database in my modified local file but tables created when i migrate but databa

new record is created while updating

2022-06-23 Thread Ayush Bajpai
model: class Batch(models.Model): batch_id = models.AutoField(primary_key=True, default=None) batch_name = models.CharField(max_length=256, default=None, null=True) ... some more fields views: def organisationEditBatch(request, batch_id): batch = Batch.objects.get(batch_id=batch_id

no such table

2022-06-23 Thread Hugh Frost
Good evening all, My project was based on django 3.2, I have an issue with migrations, my project was already in live same time I try to create two new tables after that i'm adding the live database file in local file but that shows Error : no such table i don't know how to fix this, anyone

Re: Django could not parse the remainder

2022-06-23 Thread Ryan Nowakowski
https://stackoverflow.com/questions/8252387/how-do-i-access-dictionary-keys-that-contain-hyphens-from-within-a-django-templa On Mon, Jun 20, 2022 at 07:52:46AM -0700, Koushik Romel wrote: > When trying to get a value from restapi in for loop to display it takes > hyphen(-) as minus(-). And there

Re: server can't connect in browser

2022-06-23 Thread Paul Kudla (SCOM.CA Internet Services Inc.)
ok this is networking 101 stuff if the server is running on 127.0.0.1 8000 (or whatever port) and you are trying to access from another system you need to use the ip address of the server (not 127.0.0.1) and it needs to be accesable on your network to be able to find it. best to try telnet

Re: ?? question ,its urgent

2022-06-23 Thread Soumen Khatua
Better use JSON Field to store all the informations On Mon, Jun 20, 2022 at 12:16 PM Abhinandan K wrote: > how to store the data in django databse table if user append fields > according to their need > for example i have 1 one field 1) name 2) age 3) salary and the sign('+) > if user click on +