Re: Tagging things

2006-05-18 Thread Malcolm Tredinnick
On Thu, 2006-05-18 at 12:48 +0200, Jesper Nøhr wrote: [...] > I was helped by Malcom on IRC, so the only decent thing to do, is to > post the solution here. [...] > You can call it like this: > > tags = ["foo","bar"] > > all = Contract.objects.from_tags(tags) > > What happens is that you count

Re: Tagging things

2006-05-18 Thread Jesper Nøhr
On 5/18/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: [...] I was helped by Malcom on IRC, so the only decent thing to do, is to post the solution here. I'll try to explain as well as I understand it. First some code: class Tags(models.Model): tag = models.CharField(maxlength = 50)

Re: Tagging things

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 12:56 -0700, [EMAIL PROTECTED] wrote: > Hi list, > > I'm new to Django, but I've been writing web applications for years in > Perl and PHP. A popular feature these days, are of course tagging > things. > > Tagging things is easy. You have

Re: Tagging things

2006-05-17 Thread [EMAIL PROTECTED]
Ian, Thanks for your quick reply. You have indeed implemented what I'm looking for, unfortunately, it is not as ellegant as I hoped for (no offense!). I'm perhaps mistaken, but it seems like you're brute-checking per-entry if all the tags exists. What I'd love to do is simply apply a .filter() t

Re: Tagging things

2006-05-17 Thread Ian Holsman
On 18/05/2006, at 5:56 AM, [EMAIL PROTECTED] wrote: > > Hi list, > > I have a search functionality on my page, which ideally allows people > to write a list of tags, and retrieve the entries that has those > associated. Maybe I'm overlooking the obvious here--I hope I am--but > this has become i

Tagging things

2006-05-17 Thread [EMAIL PROTECTED]
Hi list, I'm new to Django, but I've been writing web applications for years in Perl and PHP. A popular feature these days, are of course tagging things. Tagging things is easy. You have a relational table, containing your entry ID and a tag associated with it. This could easily be d