Re: Printable article page URLs?

2008-01-03 Thread Mordy Ovits
On Wednesday 02 January 2008 06:15 pm, Alex Koshelev wrote: > The second variant with GET query is the best. One resouce has one > uri but with query you specify it's display properties. I agree, and have modified my dev site to match that, using Ned Batchelder's tip of meta tags to solve the ro

Printable article page URLs?

2008-01-02 Thread Mordy Ovits
I really like Django's policy of readable URLs and one authoritative page. My question is how do I do printable versions of those nice and authoritative urls? Say I have this: http://www.site.com/articles/slug I can think of two general ways: http://www.site.com/print_articles/slug http://www

Allowed tags filter?

2007-05-14 Thread Mordy Ovits
From the docs, there are two html tag-related filters: striptags and removetags. The former removes all tags and the latter a list of banned tags. Is there a similar tag but that has an *allowed* list of tags? E.g., could allows and and only those? Thanks, Mordy --~--~-~--~~--

Re: Random features in sidebar

2007-05-14 Thread Mordy Ovits
On Monday 14 May 2007 10:54 am, Mordy Ovits wrote: > I think it would make more sense to use random.shuffle() And (after checking the python docs because I still think in Python 1.5.2), random.sample() makes even more sense. Mordy --~--~-~--~~~---~--~~

Re: Random features in sidebar

2007-05-14 Thread Mordy Ovits
On Friday 11 May 2007 07:03 pm, Benjamin Slavin wrote: > I've just uploaded a template filter called "several_random" to the > django snippets site. > http://www.djangosnippets.org/snippets/230/ The way you're picking indices is inefficient: while len(picked_indices) < arg: candidate = random

Re: Random features in sidebar

2007-05-14 Thread Mordy Ovits
On Friday 11 May 2007 06:18 pm, orestis wrote: > Put in a simple, hard coded python list and use random on this ? Straight-up random will create dupes. My current thinking is to have python code creeate a list of 3 from 7 sidebar features and in the template have INCLUDEDs surrounded by IFs.

Random features in sidebar

2007-05-11 Thread Mordy Ovits
I have a sidebar in my page design. I have 7 or so features that can go in a sidebar (links, quote of the day, infostat, on this day in history, etc.). I have models for each of those features. I can easily use django to have the template fill those out for every page, but what I want is to