Admin - Selector Inlines in 1.3?

2010-07-15 Thread andybak
Hi, As far as I know this is the only major chunk of Zain's SOC work that didn't make it into 1.2 There's a ticket for it: http://code.djangoproject.com/ticket/12509 that's at 'design decision needed' What would be needed to get this rather nice feature into 1.3? cheers, Andy -- You received

importing fixtures to postgres fails to set sequences correctly

2010-07-15 Thread Ales Zoulek
Hi guys, there seems to be a problem with django postgres backend, when importing data from fixtures. Data are imported correctly, but the sequences for primary keys are set incorrecly on models that have generic.GenericRelation field. See example: As a demo, those are just two models with generi

Re: importing fixtures to postgres fails to set sequences correctly

2010-07-15 Thread Russell Keith-Magee
On Thu, Jul 15, 2010 at 6:09 PM, Ales Zoulek wrote: > Hi guys, > > there seems to be a problem with django postgres backend, when > importing data from fixtures. Data are imported correctly, but the > sequences for primary keys are set incorrecly on models that have > generic.GenericRelation field

Re: importing fixtures to postgres fails to set sequences correctly

2010-07-15 Thread Ales Zoulek
Okay, ticket created as #13941 I'll try to find out more and let you know in this thread. Thanks, A. -- Ales Zoulek +420 604 332 515 Jabber: ales.zou...@gmail.com -- On Thu, Jul 15, 2010 a

Re: importing fixtures to postgres fails to set sequences correctly

2010-07-15 Thread Ales Zoulek
Okay, so after a little bit more investigation on that topic, I've found out: 1] It's changed since changeset 13328 (http://code.djangoproject.com/changeset/13328) 2] Previous versions DID reset the sequence thru GenericRelation fields, but it did it on the right table so it worked. It just calle

Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Mark Bucciarelli
Hi, I've just been informed by a MonetDB developer that LIMIT and ORDER BY clauses are not allowed by the SQL spec in sub-selects. I filied a bug with them because the Django code: Event.objects.all()[:1] was failing because of invalid SQL. I don't have access to the SQL spec so I can't quo

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Alex Gaynor
On Thu, Jul 15, 2010 at 1:00 PM, Mark Bucciarelli wrote: > Hi, > > I've just been informed by a MonetDB developer > that LIMIT and ORDER BY clauses are not > allowed by the SQL spec in sub-selects. > > I filied a bug with them because the Django > code: > >   Event.objects.all()[:1] > > was failin

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Mark Bucciarelli
On Thu, Jul 15, 2010 at 2:04 PM, Alex Gaynor wrote: > > It may be that they aren't allowed by the spec, but the only database > (that Django includes an adapter for) that doesn't support them > (AFAIK) is MySQL. > Cool, so that adapter has a workaround? > > Further, Event.objects.all()[:1] doesn

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Alex Gaynor
On Thu, Jul 15, 2010 at 1:14 PM, Mark Bucciarelli wrote: > On Thu, Jul 15, 2010 at 2:04 PM, Alex Gaynor wrote: >> >> It may be that they aren't allowed by the spec, but the only database >> (that Django includes an adapter for) that doesn't support them >> (AFAIK) is MySQL. >> > > Cool, so that a

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Mark Bucciarelli
On Thu, Jul 15, 2010 at 2:18 PM, Alex Gaynor wrote: > > And yes, if what you say about the SQL spec is true, then Django will > emit semantically invalid SQL.  It's also emitting SQL that can be > perfectly understood by a lot of databases.  Despite SQL being a spec > most DBs implement it slightl

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Tim Chase
On 07/15/2010 01:28 PM, Mark Bucciarelli wrote: not sure why a subselect would ever need an order by anyway. i'll have to figure out exactly what django operation generated that sql. The only time I've needed an ORDER BY in a subselect involved a LIMIT/TOP in the subselect SELECT ... FRO

Re: importing fixtures to postgres fails to set sequences correctly

2010-07-15 Thread Justin Bronn
> > there seems to be a problem with django postgres backend, when > > importing data from fixtures. Data are imported correctly, but the > > sequences for primary keys are set incorrecly on models that have > > generic.GenericRelation field. See example: I have similar code, and was griping in #d

Re: Accessible Command Output using self.stdout & self.stderr

2010-07-15 Thread Gregor Müllegger
Related to the issue with stdout/stderr: It is ofcourse possible to have wrapper in the Command class for stdout and stderr output that redirect all data to system's stdout in most cases. But this might not work for all output since we don't have control about all management commands of thirdparty

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Ian Kelly
On Thu, Jul 15, 2010 at 12:04 PM, Alex Gaynor wrote: > On Thu, Jul 15, 2010 at 1:00 PM, Mark Bucciarelli wrote: >> Hi, >> >> I've just been informed by a MonetDB developer >> that LIMIT and ORDER BY clauses are not >> allowed by the SQL spec in sub-selects. >> >> I filied a bug with them because

Re: Invalid SQL generated by objects.all()[:1]?

2010-07-15 Thread Mark Bucciarelli
On Thu, Jul 15, 2010 at 5:57 PM, Ian Kelly wrote: > > Er, I'm pretty sure that MySQL does support both ORDER BY and > LIMIT/OFFSET.  At least, it is documented as supporting them. > Right you are. There are few restrictions on the type of statements in which subqueries can be used. A subquery ca

Re: Accessible Command Output using self.stdout & self.stderr

2010-07-15 Thread Russell Keith-Magee
On Fri, Jul 16, 2010 at 5:39 AM, Gregor Müllegger wrote: > Related to the issue with stdout/stderr: > > I'm aware that Russ is not a big fan of Monkeypatching :) True :-) > but I think this > would be a legal case - since there is no other way of intercepting the real > stdout output (I'm not su

Re: importing fixtures to postgres fails to set sequences correctly

2010-07-15 Thread Ramiro Morales
On Thu, Jul 15, 2010 at 6:05 PM, Justin Bronn wrote: >> > there seems to be a problem with django postgres backend, when >> > importing data from fixtures. Data are imported correctly, but the >> > sequences for primary keys are set incorrecly on models that have >> > generic.GenericRelation field

Re: MySQL index hints

2010-07-15 Thread Simon Litchfield
Simon -- Slicing result sets is clearly the developer's responsibility IMHO. Even with hard limits, MySQL still fails miserably in many situations; hence the proposal to support hinting from the ORM. Russ -- Firstly, re namespacing. No worries, let's just keep it RDBMS- specific, ie -- MySQL -