Re: Composite primary keys

2011-03-15 Thread Yishai Beeri
On Wed, 16 Mar 2011 07:49:17 +0200, Michal Petrucha wrote: On Tue, Mar 15, 2011 at 09:15:29PM -0500, Javier Guerra Giraldez wrote: On Tue, Mar 15, 2011 at 7:14 PM, Christophe Pettus wrote: > A concern here is that composite indexes, like unique, are > sensitive to the ordering of the fiel

Re: Composite primary keys

2011-03-15 Thread Michal Petrucha
On Tue, Mar 15, 2011 at 09:15:29PM -0500, Javier Guerra Giraldez wrote: > On Tue, Mar 15, 2011 at 7:14 PM, Christophe Pettus wrote: > > A concern here is that composite indexes, like unique, are > > sensitive to the ordering of the fields, which means that the > > ordering of the fields in the cla

Re: Expensive queryset cloning

2011-03-15 Thread David Cramer
In our profiling we've also noticed the cloning to be one of the slowest parts of the app (that and instantiation of model objects). We haven't yet, but had been planning on exploring a way to mutate the existing class in most circumstances, but haven't dug into it too much yet. On Mar 14, 11:16 

Re: Wrong error message when user having is_staff=False tries to login to admin

2011-03-15 Thread Tai Lee
I also don't think it should be considered a security vulnerability to reveal that an authenticated user does not have permission to access the admin (or any other) app. If the credentials are valid and they authenticate against the defined authentication backends, then we should assume that we ar

Re: Composite primary keys

2011-03-15 Thread Javier Guerra Giraldez
On Tue, Mar 15, 2011 at 7:14 PM, Christophe Pettus wrote: > A concern here is that composite indexes, like unique, are sensitive to the > ordering of the fields, which means that the ordering of the fields in the > class declaration becomes important. a simplistic proposal: the order of the fi

Re: Composite primary keys

2011-03-15 Thread Christophe Pettus
On Mar 15, 2011, at 5:06 PM, Russell Keith-Magee wrote: > And if you mark > multiple fields, then you have a composite primary key composed of > those fields. A concern here is that composite indexes, like unique, are sensitive to the ordering of the fields, which means that the ordering of the

Re: Composite primary keys

2011-03-15 Thread Russell Keith-Magee
On Tue, Mar 15, 2011 at 11:11 PM, Andrew Godwin wrote: > On 14/03/11 21:14, Michal Petrucha wrote: >> >> Good evening (or whatever it is in everyone's timezone). >> >> I'm an undergrad computer science student at the Faculty of >> Mathematics, Physics and Informatics, Commenius University, >> Brat

Homogenization of User and UserProfile

2011-03-15 Thread Michael A. Ryan
Hello developers, I've been using Django for a couple of months now on a new project and I've come across something which I think might be improved upon. It deals with the nature of UserProfile, which I think is a very handy tool overall. The thing I'm not totally satisfied with is the way that

Re: QuerySet subclass based on namedtuple()

2011-03-15 Thread Carl Meyer
Hi Alexander, On 03/15/2011 03:30 AM, Alexander Schepanovski wrote: > It would be nice to have a QuerySet subclass based on namedtuple(). > namedtuples takes less memory than dicts (from ValuesQuerySet), much > more convenient and induce more readable code than tuples > (ValuesListQuerySet). > >

Re: Wrong error message when user having is_staff=False tries to login to admin

2011-03-15 Thread Brian O'Connor
2011/3/15 Juan Pablo Martínez > The admin is not "one more app" is (if I may) the app with more weight > on most sites. Someone who has access to the admin has access to most > or all information. There is no "one more app. " > > This has nothing to do with the argument here. The account in ques

Re: Wrong error message when user having is_staff=False tries to login to admin

2011-03-15 Thread Juan Pablo Martínez
The admin is not "one more app" is (if I may) the app with more weight on most sites. Someone who has access to the admin has access to most or all information. There is no "one more app. " Carelessness or neglect of a click in the admin should't call into question the admin with the justification

Re: Composite primary keys

2011-03-15 Thread Andrew Godwin
On 14/03/11 21:14, Michal Petrucha wrote: Good evening (or whatever it is in everyone's timezone). I'm an undergrad computer science student at the Faculty of Mathematics, Physics and Informatics, Commenius University, Bratislava, Slovakia and I'm willing to participate in this year's GSoc. I'm

QuerySet subclass based on namedtuple()

2011-03-15 Thread Alexander Schepanovski
It would be nice to have a QuerySet subclass based on namedtuple(). namedtuples takes less memory than dicts (from ValuesQuerySet), much more convenient and induce more readable code than tuples (ValuesListQuerySet). Namedtuples use same dot notation as model instances. So the same simple enough

Re: Expensive queryset cloning

2011-03-15 Thread Alexander Schepanovski
> I'd be surprised if the cloning of querysets is actually a > significant bottleneck relative to the database query itself I was too. Query via ORM is 2-4 times slower for me than just database query + network roundtrip. It is not only due queryset cloning, but cloning takes 0.5-1 of that 2-4 tim