Re: SQL Join in Django

2008-11-07 Thread Hossein
Thanks for your help. I am so close to what I want. The output that I want is an XML file. So I try: reporter = Reporter.objects.get(id=10) arts = reporter.article_set.all() xmlout = serialize('xml',arts,fields=('date','reporter.name')) However, it writes date but it does not w

Re: SQL Join in Django

2008-11-07 Thread Tim Chase
> I tried your suggested solution and instead of printing the result I > use Django serializer to create an XML file. But it seems that > something is taking too > long and my browser just stalls. Is it because of select_related() > method? I have about 200 articles per each reporter. Another pos

Re: SQL Join in Django

2008-11-07 Thread Hossein
Many thanks tim for your quick reply. You are right I meant inner join not cart product. I tried your suggested solution and instead of printing the result I use Django serializer to create an XML file. But it seems that something is taking too long and my browser just stalls. Is it because of sel

Re: SQL Join in Django

2008-11-07 Thread Tim Chase
> class Reporter() > id primary key > name > e-mail > ... > > class Article() > reporter = model.ForeignKey(reporter) > date > ... > > Now I want to implement the following SQL statement in Django: > > select name,e-mail,date from Reporter,Article where reporter

Re: SQL join--why not grab all columns?

2008-09-17 Thread Chris Stromberger
On Wed, Sep 17, 2008 at 7:40 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Wed, 2008-09-17 at 19:30 -0500, Chris Stromberger wrote: > > Disclaimer: Django newbie here. > > > > I have a join type of model access in one of my views like so: > > > > recent_staff_reviews = > > StaffReview

Re: SQL join--why not grab all columns?

2008-09-17 Thread Malcolm Tredinnick
On Wed, 2008-09-17 at 19:30 -0500, Chris Stromberger wrote: > Disclaimer: Django newbie here. > > I have a join type of model access in one of my views like so: > > recent_staff_reviews = > StaffReview.objects.order_by('-last_update').filter(enabled = > True).filter(restaurant__enabled = True)[

Re: SQL Join

2008-02-13 Thread Nicolas Steinmetz
Gus a écrit : > any help would be much appreciated Maybe this thread will help you (my issue was quite similar) Nicolas --~--~-~--~~~---~--~~ You received this message because y

Re: SQL Join

2008-02-13 Thread J. Clifford Dyer
The type field on Membership rules out m2m. There's a patch in the works (6095) to address this, and it could use testing, if you'd like to try it out. Alternatively, set up a many to one from membership to user, and from membership to group, and call the backrefs "groups" and "users" respective

Re: SQL Join

2008-02-12 Thread Alex Ezell
This doesn't answer your question directly, but wouldn't many-to-many fields help a bit here? http://www.djangoproject.com/documentation/model-api/#many-to-many-relationships Sorry if you've already thought about this and dismissed it. /alex On Feb 12, 2008 11:41 PM, Gus <[EMAIL PROTECTED]> wr