Re: django select extremely slow on large table

2015-01-22 Thread Anssi Kääriäinen
Do you fetch all the results when running the query directly against Oracle? Many Oracle SQL clients do not fetch all the results, instead they fetch just the top 100 or so rows. - Anssi On Thursday, January 22, 2015 at 5:32:36 PM UTC+2, Joris Benschop wrote: > > Dear List, > > I'm trying to r

Re: django select extremely slow on large table

2015-01-22 Thread Anssi Kääriäinen
Do you fetch all the results when running the query directly against > Oracle? Many Oracle SQL clients do not fetch all the results, instead they > fetch just the top 100 or so rows.markid = > models.CharField(unique=True, max_length=20, blank=True) > I missed the part where you said you a

Difference between Q and filter and exclude

2014-12-23 Thread Anssi Kääriäinen
These queries should be equivalent. - Anssi -- 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 post to this group, s

Deploying Django on Docker

2015-01-08 Thread Anssi Kääriäinen
For a long time I have been battling with the following problem: how to deploy Django in an easy, maintainable, secure and reliable way for small Django applications. The applications I write are mainly very low traffic, and often they are coded in a couple of days. Unfortunately the hardest pa

Re: Deploying Django on Docker

2015-01-09 Thread Anssi Kääriäinen
On Thursday, January 8, 2015 at 2:28:25 PM UTC+2, Jeroen Bakker wrote: > > Hi Anssi, > > Not really an answer to your question, but just to give you insight to a > solution. > > We at l1nda are using docker and django with small applications and large > applications. > > We developed an nginx c

Re: Deploying Django on Docker

2015-01-09 Thread Anssi Kääriäinen
On Thursday, January 8, 2015 at 1:20:39 PM UTC+2, Mike Dewhirst wrote: > > Have you seen Mezzanine fab deployment? Ken Bolton has blogged about it > ... > > http://bscientific.org/blog/mezzanine-fabric-git-vagrant-joy/ > Seems interesting. I have to play with it. The biggest issues for me are

Re: Deploying Django on Docker

2015-01-11 Thread Anssi Kääriäinen
I have given this issue a bit more thought, and it seems using Docker might be a bit too complex for the "just completed tutorial use case". Docker is nice, but if things do not work out the way you want, troubleshooting can get a bit complex. Instead it might be good to *fully* document how to

Re: How mature is Microsoft SQL Server support by the ORM?

2013-11-22 Thread Anssi Kääriäinen
Check out https://bitbucket.org/Manfre/django-mssql/overview - my understanding is that it is well maintained and supports also 2012. - Anssi On Thursday, November 21, 2013 8:20:02 PM UTC+2, CLIFFORD ILKAY wrote: > > Hello, > > There is an upcoming project where support for an existing applica

Re: prefetch_related() failure in django 1.6

2013-11-22 Thread Anssi Kääriäinen
This will be fixed in next minor version of Django 1.6. -Anssi On Friday, November 22, 2013 2:52:29 AM UTC+2, Rhett G. wrote: > > Trying to migrate our Django 1.5 application to 1.6. I hit what I think is > a bug, or at the very least very confusing behavior. > Imagine some models like the fol

Re: Prefetch object (django 1.7)

2014-01-29 Thread Anssi Kääriäinen
To me it seems you are mixing the authors m2m relation and the through model. The 'authors' relates to User, not PostAuthor. But your queryset is pointing to PostAuthors. If you want to fetch PostAuthor instances, then you should likely prefetch with Prefetch('postauthors', PostAuthors.objects.

Re: Optimizing DB query involving annotate and aggregate

2014-02-05 Thread Anssi Kääriäinen
Something like this might work: Transaction.objects.values_list('member_id').annotate(total=Sum('amount')).filter(total__gt=0).aggregate(Sum('total')) That is, don't start from Member, Django isn't smart enough to get rid of the non-necessary joins. Instead go directly for the query you wrot

Re: Database operators for custom fields

2014-02-19 Thread Anssi Kääriäinen
If I am not mistaken you are trying to alter how .filter(customfield__eq=val) and friends work. In current Django versions you can't easily customize the SQL generated for ORM lookups. In Django 1.7 (currently in alpha) this is possible using custom lookups. Custom lookups will allow you to alt

Re: Weird issue with transaction.atomic in django 1.6

2014-02-26 Thread Anssi Kääriäinen
On Wednesday, February 26, 2014 11:58:54 PM UTC+2, tapan pandita wrote: > > I am using transaction.atomic as a context manager for transactions in > django 1.6. There is a block of code which I want to be in a transaction > which has a couple of network calls and some database writes. I am seeing

Re: Django 1.6 test cases for code which calls transaction.set_autocommit()

2014-03-06 Thread Anssi Kääriäinen
On Friday, March 7, 2014 12:11:59 AM UTC+2, Justin Michalicek wrote: > > It appears that due to test cases running in an atomic block, testing > methods which use transaction.set_autocommit() all fail. I've got a small > handful of test cases around methods which need to use manual transaction

Re: Queryset Filters

2014-04-08 Thread Anssi Kääriäinen
No, there is no way to do what you want. All filters are implemented as filters in the DB, Django doesn't know how to execute them in Python. There was some effort to implement filters also in Python, but there hasn't been any activity on this recently. The only way to do this currently is to i

Re: Full text search available on PostgreSQL?

2014-06-29 Thread Anssi Kääriäinen
On Saturday, June 28, 2014 7:15:05 PM UTC+3, Bastian Kuberek wrote: > > Hi, > > Just saw that django.contrib.admin.ModelAdmin.search_fields > > full > text search only support MySQL. > > Are