Re: Avoid unbounded memory consumption when running `manage.py test`

2013-07-30 Thread Christopher Bailey
Hi Matt, But I'm interested to know if others run into similar problems and how you > solve them. > We hit the same problem and used a similar tearDownClass solution http://chrisbailey.blogs.ilrt.org/2013/05/19/pythons-leaky-testcase-aka-hidden-gotchas-using-self/ Chris. -- You received this

Re: Proposal: Modifying the CSRF protection scheme

2013-07-30 Thread Jacob Kaplan-Moss
Hey Shai - I have no objections to this change. I think it's got a slight whiff of security theatre, in that it *looks* like it adds more protection than it *actually* does. However, I, too, have spent a ton of time talking auditors down from "OMG Django is vulnerable to CSRF!" and I'd like to do

Re: Proposal: Modifying the CSRF protection scheme

2013-07-30 Thread Paul McMillan
I agree with Jacob on both points. +1 from me, especially since neither of these changes should require changes in application code which is already using the interface correctly. -Paul On Tue, Jul 30, 2013 at 1:22 PM, Jacob Kaplan-Moss wrote: > Hey Shai - > > I have no objections to this chang

Support Negative Indexing on QuerySets

2013-07-30 Thread Mark Young
In this support ticket (https://code.djangoproject.com/ticket/13089), the original closer said "This is a long-standing explicit design decision in the ORM, and so gets a wontfix...". What is the reasoning behind this? Why is negative indexing of querysets disallowed? Thanks! -- You received

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Florian Apolloner
Hi Mark, How do you think such support would look like? For negative indices you'd have to know the size of the resultset to be able to do "limit somthing offset length-your_negative_index" -- this doesn't seem to make any sense for an ORM. You can always do list(qs)]:-1] though… Cheers, Flori

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Andre Terra
On Tue, Jul 30, 2013 at 6:06 PM, Florian Apolloner wrote: > You can always do list(qs)]:-1] though… Although you really shouldn't [1]. As for the reasons for disallowing negative indexes, dcramer's comment in the ticket makes it clear: there is no way to infer what the last item in a query woul

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Florian Apolloner
On Tuesday, July 30, 2013 11:34:18 PM UTC+2, Andre Terra wrote: > > On Tue, Jul 30, 2013 at 6:06 PM, Florian Apolloner > > > wrote: > >> You can always do list(qs)]:-1] though… > > > Although you really shouldn't [1]. Right, it depends on your usecase; I was just trying to point out other alte

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Wim Lewis
On 30 Jul 2013, at 2:06 PM, Florian Apolloner wrote: > How do you think such support would look like? For negative indices you'd > have to know the size of the resultset to be able to do "limit somthing > offset length-your_negative_index" -- this doesn't seem to make any sense for > an ORM. Yo

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Andre Terra
On Tue, Jul 30, 2013 at 6:55 PM, Florian Apolloner wrote: > Right, it depends on your usecase; I was just trying to point out other > alternatives aside from the ones mentioned on the ticket. I'm sorry if I seemed arrogant in my post. I most definitely did not intend it, as I was absolutely sure

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Florian Apolloner
On Wednesday, July 31, 2013 1:03:31 AM UTC+2, Andre Terra wrote: > > On Tue, Jul 30, 2013 at 6:55 PM, Florian Apolloner > > > wrote: > >> Right, it depends on your usecase; I was just trying to point out other >> alternatives aside from the ones mentioned on the ticket. > > > I'm sorry if I se

Re: Support Negative Indexing on QuerySets

2013-07-30 Thread Florian Apolloner
Hi Wim, On Wednesday, July 31, 2013 12:04:42 AM UTC+2, Wim Lewis wrote: > > On 30 Jul 2013, at 2:06 PM, Florian Apolloner wrote: > > How do you think such support would look like? For negative indices > you'd have to know the size of the resultset to be able to do "limit > somthing offset lengt