AW: outer joins, raw sql or one-to-many?

2011-05-10 Thread Szabo, Patrick (LNG-VIE)
34 52 - 1573 Fax: +43 (1) 534 52 - 146 -Ursprüngliche Nachricht- Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Michel30 Gesendet: Dienstag, 10. Mai 2011 09:48 An: Django users Betreff: Re: outer joins, raw sql or one-to-many? wow this works :

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Michel30
s.at > Tel.: +43 (1) 534 52 - 1573 > Fax: +43 (1) 534 52 - 146 > > -Ursprüngliche Nachricht- > > Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im > Auftrag von Kenneth Gonsalves > Gesendet: Dienstag, 10. Mai 2011 09:34 > An: django-users@go

AW: outer joins, raw sql or one-to-many?

2011-05-10 Thread Szabo, Patrick (LNG-VIE)
@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Kenneth Gonsalves Gesendet: Dienstag, 10. Mai 2011 09:34 An: django-users@googlegroups.com Betreff: Re: outer joins, raw sql or one-to-many? On Tue, 2011-05-10 at 00:26 -0700, Michel30 wrote: > {{ some_thing.firstname }} ma

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Kenneth Gonsalves
On Tue, 2011-05-10 at 00:26 -0700, Michel30 wrote: > {{ some_thing.firstname }} maybe {{ some_thing.submitter.firstname }} -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "D

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Michel30
Oops slip of the mouse there :-) I've tried setting up the relations before like my previous post. But then when I want to fetch data with, for example: some_thing = Documentrevision.objects.filter(some_filter criteria) and then use it in my form like this: {{ some_thing.firstname }} Ther

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Kenneth Gonsalves
On Tue, 2011-05-10 at 00:18 -0700, Michel30 wrote: > I tried that before using: > submitterid = models.ForeignKey('Author', to_field='authorid') that is the correct way (although I would prefer to call the field submitter) -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilu

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Michel30
Hi Kenneth, I tried that before using: submitterid = models.ForeignKey('Author', to_field='authorid') On May 10, 9:07 am, Kenneth Gonsalves wrote: > On Mon, 2011-05-09 at 23:56 -0700, Michel30 wrote: > > Now, for every documentid I retrieve I want to find it's firstname and > > lastname. Authori

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Jani Tiainen
On Mon, 2011-05-09 at 23:56 -0700, Michel30 wrote: > Hey all, > > I'm having trouble wrapping my head around querying multiple tables > with relations between them. > I'm writing an (cms-like) app that will use an existing mysql > database. I modeled that, got my code up and running and am now in

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Kenneth Gonsalves
On Mon, 2011-05-09 at 23:56 -0700, Michel30 wrote: > Now, for every documentid I retrieve I want to find it's firstname and > lastname. Authorid relates to submitterid in this case. submitter should be foreign key to author - then all your problems will go away. -- regards KG http://lawgon.livej

outer joins, raw sql or one-to-many?

2011-05-09 Thread Michel30
Hey all, I'm having trouble wrapping my head around querying multiple tables with relations between them. I'm writing an (cms-like) app that will use an existing mysql database. I modeled that, got my code up and running and am now in the process of trying to retrieve and submit data to it. Here i