Re: Introducing DjangoSites.Org

2007-06-22 Thread natebeaty
It would be great if there was some sort of "Thanks for the submission! We will post your site after it is reviewed.." notice after submitting each site. Right now it just dumps you back in the homepage w/ no feedback as to whether the site submission was received or not. Otherwise, looks great s

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread natebeaty
Ivan Sagalaev wrote: > Apart from these two ways of working around views there is also a > 'template context processor' thingy. It's like extra_context but not > static. It's a custom function returning context dict that is called for > every view (well not exactly every view but it doesn't matter

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread natebeaty
Kai Kuehne wrote: > If you only want to list the tags related to the current blog entry (e.g., on > a object_detail generic view site) I would wrap the generic view instead > of filling the urls.py file with logic. Imho, there should be no logic > in urls.py > > And that is what I'm trying to unde

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread natebeaty
Ivan Sagalaev wrote: > Actually I've forgot 'distinct' yet again: > > Tag.objects.filter(blog__id__isnull=False).distinct() > > ...or there would be dupes in the result. Awesome, thanks so much Ivan. Another quick question, where is the best place to put this? I made the mistake of putting

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-17 Thread natebeaty
On Jan 17, 5:03 am, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Ah... You mean "all tags that have relation to any blog". This is it: > > Tag.objects.filter(blog__id__isnull=False) Perfect! Yeah, "all tags that have relation to any blog" -- that's what I was trying to say! Worked like a char

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-17 Thread natebeaty
Ivan Sagalaev wrote: This is in fact pretty standard Django ORM, nothing special to TagsField: blog.tag_set.all() Thanks Ivan, but I was hoping to get a list of all tags not only related to the *current* blog entry (I'm already using this in my template), but *all* blog entries. I'd like

how to list all Tags for Blog? or simple m2m filtering...

2007-01-16 Thread natebeaty
I'm assuming this is simple... hoping so at least! Spent the last few hours googling w/ no luck. I'm using the TagsField from: http://softwaremaniacs.org/soft/tags/en/ and I have many classes using this m2m TagsField. What I'm stumped on is how to pull a list of all the tags that are used by one

Re: Generic views and filtering

2007-01-15 Thread natebeaty
You can do this without a wrapper -- your url entry was close: (r'^tag/(?P[-\w]+)/$','django.views.generic.list_detail.object_detail', dict(queryset=Tag.objects.all(), template_object_name='tag', slug_field='url')), and you'll get a list in /templates/tags/tag_detail.html called post_set: