Re: DRF and self join

2015-08-23 Thread Shekar Tippur
is probably the hard part though. > > -James > On Aug 20, 2015 9:12 PM, "Shekar Tippur" > > wrote: > >> Hello, >> >> I am looking for a model/serializer/view for a self join. I can have >> nested paernt child relationship. >> >> The one

Re: DRF and self join

2015-08-20 Thread James Schneider
er is probably the hard part though. -James On Aug 20, 2015 9:12 PM, "Shekar Tippur" wrote: > Hello, > > I am looking for a model/serializer/view for a self join. I can have > nested paernt child relationship. > > The one I am trying: > > model: > > c

DRF and self join

2015-08-20 Thread Shekar Tippur
Hello, I am looking for a model/serializer/view for a self join. I can have nested paernt child relationship. The one I am trying: model: class ParentChild(models.Model): parent=models.CharField(max_length=100, blank=False, default='', unique =True) child=models.Foreig

Re: Self Join

2010-03-15 Thread Karen Tracey
On Fri, Mar 12, 2010 at 5:54 PM, jrs wrote: > I'm trying, without a great deal of success, to perform a simple self > join using the django orm. I'm pretty sure the F() function is not > the answer. I believe this only allows you to compare two field > within the same

Re: Self Join

2010-03-15 Thread jrs
I see nothing on this page that is in the slightest bit related to my > > question... Does anyone know if there is a way in the django orm to > > accomplish my query above? > > > Thanks. > > As I explained, there's nothing different in a self-join than with any > o

Re: Self Join

2010-03-15 Thread Daniel Roseman
On Mar 15, 1:40 pm, jrs wrote: > I see nothing on this page that is in the slightest bit related to my > question... Does anyone know if there is a way in the django orm to > accomplish my query above? > > Thanks. As I explained, there's nothing different in a self-join than

Re: Self Join

2010-03-15 Thread jrs
I see nothing on this page that is in the slightest bit related to my question... Does anyone know if there is a way in the django orm to accomplish my query above? Thanks. On Mar 13, 4:17 am, Daniel Roseman wrote: > On Mar 12, 10:54 pm, jrs wrote: > > > > > I'm trying, without a great deal of

Re: Self Join

2010-03-13 Thread Daniel Roseman
On Mar 12, 10:54 pm, jrs wrote: > I'm trying, without a great deal of success, to perform a simple self > join using the django orm.  I'm pretty sure the F() function is not > the answer.  I believe this only allows you to compare two field > within the same model instance,

Self Join

2010-03-12 Thread jrs
I'm trying, without a great deal of success, to perform a simple self join using the django orm. I'm pretty sure the F() function is not the answer. I believe this only allows you to compare two field within the same model instance, not to compare fields within 2 instances of the same

Noob: Can you use the ORM to do a self join with an aggregate?

2010-02-25 Thread Peter Phillips
Just started in the last few days with django and am having a little trouble with the orm. Is it possible to do a self join with an aggregate? My query looks like the following (apologies for the generic names): SELECT t.field1, c.field2, c.field3, t.field4, t.field5, (t.field4/ t.field5) as

Re: Self Join using QuerySet

2009-03-05 Thread Alex Gaynor
rs-can-reference-fields-on-the-model > > On Mar 5, 1:46 pm, Adam Nelson wrote: > > Is it possible to do a self join using QuerySet? > > > > I'm looking to simulate a query like this: > > > > SELECT b.created_on, SUM(a.vote) > > FROM votes a JOIN votes

Re: Self Join using QuerySet

2009-03-05 Thread AJ
wrote: > Is it possible to do a self join using QuerySet? > > I'm looking to simulate a query like this: > > SELECT b.created_on, SUM(a.vote) > FROM votes a JOIN votes b ON a.created_on <= b.created_on > WHERE a.object_id = 1 > GROUP BY 1 > > Which finds the sums

Self Join using QuerySet

2009-03-05 Thread Adam Nelson
Is it possible to do a self join using QuerySet? I'm looking to simulate a query like this: SELECT b.created_on, SUM(a.vote) FROM votes a JOIN votes b ON a.created_on <= b.created_on WHERE a.object_id = 1 GROUP BY 1 Which finds the sums for votes before the datetime of e