Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Kevin Jay
*From:* django-users@googlegroups.com [mailto: > django-users@googlegroups.com] *On Behalf Of *b...@tanners.org > *Sent:* Monday, May 6, 2019 12:44 PM > *To:* Django users > *Subject:* Re: ORM help with INNER JOIN and GROUP BY > > > > Just want to make sure I understand. ForeighKeys need

Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread bob
; > *From:* django...@googlegroups.com [mailto: > django...@googlegroups.com ] *On Behalf Of *b...@tanners.org > > *Sent:* Monday, May 6, 2019 11:28 AM > *To:* Django users > *Subject:* ORM help with INNER JOIN and GROUP BY > > > > I've inherited an applicati

Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Kevin Jay
Maybe that was a typo? The foreignkey relationship would look like this: object = models.ForeignKey(FacePng'', max_length=128, blank=False, null=False, unique=True) On Mon, May 6, 2019 at 12:44 PM wrote: > Just want to make sure I understand. ForeighKeys need to be integers? > > Only integers?

RE: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Matthew Pava
: Re: ORM help with INNER JOIN and GROUP BY Just want to make sure I understand. ForeighKeys need to be integers? Only integers? You need a ForeignKey relationship between the two models, which is an integer value, not a char. You’d have to do migrations to get this adjusted properly. -- You

Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread bob
Just want to make sure I understand. ForeighKeys need to be integers? Only integers? You need a ForeignKey relationship between the two models, which is an > integer value, not a char. You’d have to do migrations to get this adjusted > properly. > -- You received this message because you a

Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Kevin Jay
The field within your class should be set to ForeignKey. Try this: Object = models.ForeignKey(‘FacePng’, on_delete=SET_NULL, max_length= some_int) on_delete and max_length need to be set based on your requirements Sent from my iPhone > On May 6, 2019, at 11:28 AM, b...@tanners.org wrote: > >

RE: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Matthew Pava
users Subject: ORM help with INNER JOIN and GROUP BY I've inherited an application written django 1.11. The old application uses raw() with INNER JOIN and GROUP BY. I cannot seem to figure out how to do inner join and group by properly the ORM way. The raw() query is below. S

ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread bob
I've inherited an application written django 1.11. The old application uses raw() with INNER JOIN and GROUP BY. I cannot seem to figure out how to do inner join and group by properly the ORM way. The raw() query is below. SELECT * FROM items_monolithic INNER JOIN items_facepng ON items_monoli

Re: ORM help

2011-04-26 Thread Carl Meyer
Hi Daniel, On Apr 22, 5:57 pm, Daniel Gerzo wrote: > I have a following models: > > class Movie(models.Model): >      title = models.CharField(max_length=255) >      year = models.IntegerField(max_length=4) >      rating = models.DecimalField(max_digits=2, decimal_places=1, default=0) > > class R

ORM help

2011-04-22 Thread Daniel Gerzo
Hello guys, I have a following models: class Movie(models.Model): title = models.CharField(max_length=255) year = models.IntegerField(max_length=4) rating = models.DecimalField(max_digits=2, decimal_places=1, default=0) class Request(models.Model): movie = models.ForeignKey(Movi