Re: Finding entries with multiple tags

2006-09-05 Thread Malcolm Tredinnick
On Tue, 2006-09-05 at 18:27 -0700, robbie wrote: > Malcolm Tredinnick wrote: > > I am really close to finishing the rewrite work necessary to make this > > easy. It's a bug that it doesn't work already. > > Is there a Django ticket for this bug? I think it's also in the way for > something I'm tr

Re: Finding entries with multiple tags

2006-09-05 Thread robbie
Malcolm Tredinnick wrote: > I am really close to finishing the rewrite work necessary to make this > easy. It's a bug that it doesn't work already. Is there a Django ticket for this bug? I think it's also in the way for something I'm trying to do, so it would be good to track its progress... (I

Re: Finding entries with multiple tags

2006-08-29 Thread [EMAIL PROTECTED]
> I am really close to finishing the rewrite work necessary to make this > easy. It's a bug that it doesn't work already. You should be able to > filter using > > Post.objects.filter(tag = 'django').filter(tag = 'python') Yes! This is what I tried before but noticed it did not work (the s

Re: Finding entries with multiple tags

2006-08-29 Thread Chris Kelly
agreed with Malcom on this one:you should be splitting the url string at the top (removing the last blank entry) to get the array of tags.from there you can just iterate over the tags array until you hit the end in a for loop. then in that for loop, just call a filter on the queryset, using the cur

Re: Finding entries with multiple tags

2006-08-29 Thread Malcolm Tredinnick
On Tue, 2006-08-29 at 14:05 +, [EMAIL PROTECTED] wrote: > > > Yes, you are right. I was not thinking straight. > > Not a problem. Help is always appreciated! > > > > Anyone know what the > > > best method for performing this in SQL would be? Select all posts for > > > each tag and use inte

Re: Finding entries with multiple tags

2006-08-29 Thread DavidA
[EMAIL PROTECTED] wrote: > That works easily when you're just looking up one Tag. What I'm trying > to figure out is the best way to search for multiple tags and return > only the Posts common to all of those tags: Joe, My bad. I misunderstood your question. I think the only way to do this (in S

Re: Finding entries with multiple tags

2006-08-29 Thread [EMAIL PROTECTED]
> > Yes, you are right. I was not thinking straight. Not a problem. Help is always appreciated! > > Anyone know what the > > best method for performing this in SQL would be? Select all posts for > > each tag and use intersect? > > With ManyToMany relationships, you have to think of chasing the

Re: Finding entries with multiple tags

2006-08-29 Thread DavidA
Gary Wilson wrote: > [EMAIL PROTECTED] wrote: > > > def tags(request, url): > > > # Don't need the last item in the list since it will > > > # always be an empty string since Django will append > > > # a slash character to the end of URLs by default. > > > tags = url.split('/')[:-1

Re: Finding entries with multiple tags

2006-08-28 Thread Gary Wilson
[EMAIL PROTECTED] wrote: > > def tags(request, url): > > # Don't need the last item in the list since it will > > # always be an empty string since Django will append > > # a slash character to the end of URLs by default. > > tags = url.split('/')[:-1] > > posts = Post.objects.

Re: Finding entries with multiple tags

2006-08-28 Thread [EMAIL PROTECTED]
> Using .* in your URL regexes is not recommended, you only want to match > what you absolutely need to match. Something like the following would > be better: > > (r'^tags/(?P([a-zA-Z0-9-]+/)+)$', 'ssrc.blog.views.tags') OK, cool. Thanks! > This could be very much simplified now, and with the r

Re: Finding entries with multiple tags

2006-08-27 Thread Gary Wilson
[EMAIL PROTECTED] wrote: > Hello - > > I'm playing around with a blog application and I want it to have a > tagging feature. I have the usual ManyToMany relationship set up with > Post and Tag (I'm not going to past my model since I think everyone is > familiar with this kind of setup). > > I have

Finding entries with multiple tags

2006-08-27 Thread [EMAIL PROTECTED]
Hello - I'm playing around with a blog application and I want it to have a tagging feature. I have the usual ManyToMany relationship set up with Post and Tag (I'm not going to past my model since I think everyone is familiar with this kind of setup). I have three Posts tagged as follows: Po