Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread Kevin Jay
ango-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 to be inte

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 application written

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

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. SELECT

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