Re: PostgreSQL, queries, speed

2014-06-16 Thread Lachlan Musicman
Thanks Russ, appreciated. Out of interest, how do people use plpythonu in postgres when virtualenv'd? I'm seeing a lot of "set the PYTHONPATH envvar in Postgres" answers is this the way? What if I have 3 virtualenvs (dev, stage, prod) on the same machine, each grabbing a different DB (dev,

Re: PostgreSQL, queries, speed

2014-06-16 Thread Russell Keith-Magee
On Tue, Jun 17, 2014 at 9:25 AM, Lachlan Musicman wrote: > Thank Glen, appreciated. > > Now reading about indexes I can't believe I've not used them previously. > Indicies are definitely your friend - *especially* on PostgreSQL. :-) > Does the addition of "db_index=True" to

Re: PostgreSQL, queries, speed

2014-06-16 Thread Lachlan Musicman
Thank Glen, appreciated. Now reading about indexes I can't believe I've not used them previously. Does the addition of "db_index=True" to a field require a migration, or is it acceptable to just add. I guess that it will require a migration, since it's a DB level change. Or an instruction to the

Re: PostgreSQL, queries, speed

2014-06-16 Thread Glen Jungels
You should definitely be able to accomplish what you are needing with a stored function in PostgreSQL. By sending only a single request and letting the database server do the processing for you, you'll minimize how much work the web server has to do. That said, writing a stored

Re: PostgreSQL, queries, speed

2014-06-16 Thread Lachlan Musicman
tkc, You make good points, and I will need to look into better use of Django first - aggregates and the like. I have seen the queries sent, and there are plenty. The problem isn't that we are sending 5000 rows - some parts have hundreds of Buckets, each Bucket needs to be tested that it has

Re: PostgreSQL, queries, speed

2014-06-16 Thread Tim Chase
On 2014-06-17 10:08, Lachlan Musicman wrote: > The problem is that even with a relatively small number of parts > (<5000) and only 4 currencies (USD, AUD, EUR, GBP) we are seeing > page rendering slow down as each of those queries is sent off to be > worked out. A couple things occur to me: -

PostgreSQL, queries, speed

2014-06-16 Thread Lachlan Musicman
Hola, In an inventory system, I've got a PartNumber model and a Buckets model - each bucket holding one or more instances of a part number. Each instance can have a separate price and currency - depending on date and supplier these can fluctuate. >From this data we would like to extract total

Conver sql to orm django

2014-06-16 Thread jose alejandro hernandez rosales
Hi , everyone i have a little problem, how do I convert this sql sentence to ORM? SELECT * FROM CLIENTS LEFT JOIN rutas ON clientes.ruta_id = rutas.ID LLEFT JOIN repartidores ON clientes.ruta_id = repartidores.ruta_id -- You received this message because you are subscribed to the Google Groups

Re: How to install psycopg2 using Pip?

2014-06-16 Thread Bill Freeman
One possibility is that you have it, but it is in a directory that is not on you path. Try: find / -name pg_config 2> /dev/null If this finds the executable, you can add the directory your current invocation of the shell (It will be gone when you log out and back in) to do the pip install.

RE: Is it possible to get working django transaction with django multiple databases

2014-06-16 Thread Ilya Kazakevich
I believe you need software that supports distributed transaction coordination protocols ("X/Open XA" Is good example) and both DBs should support this protocol and two-phase commit. Ilya Kazakevich, JetBrains PyCharm (Best Python/Django IDE) http://www.jetbrains.com/pycharm/ "Develop with

Re: second level nested inlines not showing in django-nested-inlines

2014-06-16 Thread Hangloser Firestarter
Someone managed to solve this problem? I have this problem, too. The level 1 is OK, but level 2 not functionate! -- 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

Is it possible to get working django transaction with django multiple databases

2014-06-16 Thread Juan Jose Huelga
Hi there. I'm trying to get a django site working with multiple databases, it means a DB1 for django site an another existing DB2 (say a legacy BD) but I need transactions enabled. I need to run queries over BD2 that depends on queries over DB1 and the other way around. If any of these queries

Re: trying to configure MSSQL 2012 as backend with Django.

2014-06-16 Thread Michael Manfre
>From looking at the configuration that was posted, the solution was likely to remove "django.db.backends." from the ENGINE. That prefix is only for backends that are included with Django. Regards, Michael Manfre On Sunday, June 15, 2014 5:33:45 PM UTC-4, Ezequiel Bertti wrote: > > What was

Raw query

2014-06-16 Thread Ahmed Adam
I want to create series of tables using mysql raw query with multiple lines in django view. 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

Stack Overflow Open Source Advertising, 2H 2014

2014-06-16 Thread Jorge Cardoso Leitão
As part of the Stack Overflow free Vote-Based advertising for open source for the second half of 2014

Re: CSRF Token Help

2014-06-16 Thread Andreas Kuhne
The cookie is set via the django.middleware.csrf.CsrfViewMiddleware middleware. It does all of the handling for csrf tokens. It has to be included in your middleware classes. Also the order of the middleware classes are important (at least some of my middleware didn't work if it wasn't in the