Re: Patch and tests for #13182

2010-08-05 Thread David Novakovic
Noted... sorry about the spam in that case :) D On Aug 6, 10:52 am, Russell Keith-Magee wrote: > On Fri, Aug 6, 2010 at 8:31 AM, David P. Novakovic > > wrote: > >http://code.djangoproject.com/ticket/13182 > > Let me know if there is anything

Patch and tests for #13182

2010-08-05 Thread David P. Novakovic
http://code.djangoproject.com/ticket/13182 Let me know if there is anything else I can do on this ticket, it is fairly simple anyway. David -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread Jacob Kaplan-Moss
On Thu, Aug 5, 2010 at 6:14 PM, OverKrik wrote: > Hi Jeremy, I will release all my code after finishing the test suite - > I think, in about 2 weeks. I'm looking forward to seeing it. I agree that the results are counter-intuitive; seems there's *something* going on here that

Patch and tests for #12295

2010-08-05 Thread David P. Novakovic
Mornin' I've attached a patch with unit tests and updated the existing patch. Let me know if there is anything else I can do on this one. David -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread OverKrik
Hi Jeremy, I will release all my code after finishing the test suite - I think, in about 2 weeks. On Aug 6, 2:59 am, Jeremy Dunck wrote: > On Thu, Aug 5, 2010 at 4:32 PM, OverKrik wrote: > > I am performing every test 10 times, excluding one fastest and one

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread Jeremy Dunck
On Thu, Aug 5, 2010 at 4:32 PM, OverKrik wrote: > I am performing every test 10 times, excluding one fastest and one > slowest result, restarting db every time and performing 10 000 request > to warm db before measuring execution time. > Just in case, I've tried running tests

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread OverKrik
1. users = User.objects.only("power_level")[:50] for user in users.iterator(): d = user.power_level 2. users = User.objects.all()[:50] for user in users.iterator(): d = user.power_level 1. ~24 sec 2. ~28 sec This one looks correct. But I am a bit confused,

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread Alex Gaynor
On Thu, Aug 5, 2010 at 5:32 PM, OverKrik wrote: > I am performing every test 10 times, excluding one fastest and one > slowest result, restarting db every time and performing 10 000 request > to warm db before measuring execution time. > Just in case, I've tried running tests

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread OverKrik
I am performing every test 10 times, excluding one fastest and one slowest result, restarting db every time and performing 10 000 request to warm db before measuring execution time. Just in case, I've tried running tests in only-full-only-full and defer-full-defer-full patters and got same

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread OverKrik
Hi Jacob, thx for reply and sorry for not enough additional info in original post. I was thinking that this issue can be related only to python part of the bench, as everything looked ok with queries. Just in case I've tested query generated by only\defer queryset using raw SQL bench and compared

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread Dennis Kaarsemaker
On do, 2010-08-05 at 16:09 -0500, Jacob Kaplan-Moss wrote: > - What database engine are you using? > - Where's the database being stored (same server? other server? > in-memory?) > - How much data is in the database? > - How big is that "info" field on an average model? - Were OS/database level

Re: Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread Jacob Kaplan-Moss
On Thu, Aug 5, 2010 at 3:44 PM, OverKrik wrote: > Hi, I am testing performance of three querysets Good! We need as many benchmarks as we can get our hands on. > I was expecting first two querysets to be faster, but for some reason > it takes about ~105sec to finish (3) and

Querysets with "only()" and "defer()" slower than without?

2010-08-05 Thread OverKrik
Hi, I am testing performance of three querysets 1. for pk in xrange(1,5): user = User.objects.only("power_level").get(pk = pk) d = user.power_level 2. for pk in xrange(1,5): user = User.objects.defer("name","email","age","info").get(pk = pk) d =

Re: Model translation

2010-08-05 Thread Beres Botond
Hi JK, Actually there is a model translation app which uses a very similar approach to what you describe and already covers a good chunk of your 6 points. A few months ago I needed to add dynamic translation to a fairly large project, I looked into most of the existing model translation apps,

Re: Model translation

2010-08-05 Thread JK Laiho
Oops. A mistake here: # class Animal_fi(models.Model): # name = models.ShadowingOneToOneField(Animal) The "name" field wouldn't be a ShadowingOneToOneField, but a CharField like that in the original Animal model. We'd rather need a model inheritance-like pointer field to be the ShadowO2O. -

Re: Model translation

2010-08-05 Thread JK Laiho
Hi all, Having popped my head in to the previous model translation thread in December, I'll do so here as well. I apologize for the length of this post, but the issue is complex, so it can't really be helped. Last time around I mentioned having some ideas on how to maybe do model translation in

Re: Model translation

2010-08-05 Thread stefanw
Hi Hejsan, we discussed this topic at the sprints of DjangoCon.eu some time ago. There is a page in the wiki for this topic where we summarized some ideas: http://code.djangoproject.com/wiki/ModelInterNationalization Instead of one of the existing solutions (which all have serious drawbacks), I