Re: Django Channels Error: WebSocket connection to 'ws://openchat.us:24711/' failed: WebSocket is closed before the connection is established.

2017-05-21 Thread James Schneider
On May 20, 2017 8:33 PM, "djangorobert" wrote: hi james im going off of andrew godwins django channels example on github the multi chat example and using Webfactions hosting services. im getting the error of the websocket being closed I know your saying to maybe chaning it to wss instead of ws d

How to config Django for Oracle RAC mode

2017-05-21 Thread hu huaxuan
Dear django-users, We have two kinds of web servers. One is based on Java(tomcat + spring boot), while another is based on Python(Django). Recently we changed our Oracle db to RAC mode, which theJava server can successfully connect to it by following config: jdbc:oracle:thin:@(DESCRIPTION=(EN

Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Yo'av Moshe
Hey Djangoists! I can't get my head around this and I'm not sure if it's even possible. Let's say I have an "Adult" object and a "Child" object. Every Child belongs to an Adult, and has a gender which is either "M" or "F", and also a "dob" field with their date of birth. I want to get a list of

Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Simon Charette
Hello Yo'av, You'll want to use subqueries for this[0]. from django.db.models import OuterRef, Subquery children = Child.objects.filter(adult=OuterRef('pk')).order_by('dob').values('dob') Adult.objects.annotate( oldest_son_dob=Subquery(children.filter(gender='M')[:1]), oldest_daughter_

Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Yo'av Moshe
Thanks, never heard of Subqueries before! It's time to upgrade to Django 1.11 I guess. Performance-wise, do you know if it's any different than running over my Adult objects and for each one of them running a separate query looking for their oldest son & daughter? Or is it the same and it just

Re: Where is all the time going?

2017-05-21 Thread James Schneider
On May 21, 2017 5:50 AM, "Bernd Wechner" wrote: I'm a tad stuck with a slow performing form, like 30s to load, totally studding, on a high specced local dev machine. It's a generic CreateView, and the Django Toolbar reports this: The relevant code for your view, form, template, and model would

Re: Django Internship

2017-05-21 Thread ludovic coues
you can put you're resume on your website 2017-05-19 10:42 GMT+02:00 Mannu Gupta : > > > On Wednesday, May 17, 2017 at 3:25:42 PM UTC-4, mark wrote: >> >> A couple of comments.. >> >> 1. This list is not for job hunting. Learn how to post correctly on email >> lists. In this instance, you need an

sqlite3 table not found

2017-05-21 Thread jjanderson52000
Hi, I'm fairly new to Django and I'm very much still in the learning process. I'm using Django 1.10.3 on a project and have just added some new models. When I run the server and enter a URL to visit one of my views, I get an error, an excerpt of which is shown below: File "/home/jja/testen

Re: sqlite3 table not found

2017-05-21 Thread James Schneider
On May 21, 2017 8:49 AM, wrote: Hi, I'm fairly new to Django and I'm very much still in the learning process. I'm using Django 1.10.3 on a project and have just added some new models. When I run the server and enter a URL to visit one of my views, I get an error, an excerpt of which is shown

Re: Building correct queryset

2017-05-21 Thread Горобец Дмитрий
Andrew, your solution works great for one brand. But I have more than one. суббота, 20 мая 2017 г., 0:20:18 UTC+5 пользователь Andrew Beales написал: > > brand = Brand.objects.get(title='mybrand') > products = Product.objects.filter(brand=brand).order_by('-score')[:4] > > ...gets you the top 4 pro

Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Simon Charette
> Performance-wise, do you know if it's any different than running over my Adult objects and for each one of them running a separate query looking for their oldest son & daughter? Or is it the same and it just looks better? It should perform better as everything will be performed in a single que

Re: How to fix "plural forms expression could be dangerous"

2017-05-21 Thread Martin Brochhaus
Thanks for the reply, Tom. Inserting those values does indeed make the error go away, but I am still left with the issue that on each deployment, when I run `./manage.py makemessages`, it overwrites that line with the faulty one and my site is left in a broken state. Anyone knows how to preven