Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Steve Holden
Jacob Kaplan-Moss wrote: > I'm with Steve:: > > {% for %} ... {% default %} .. {% endfor %} > > ... seems best. > > Agreement is great, but my suggestion was actually {% for %} ... {% empty %} ... {% endfor %} I feel this says more than "default", which requires you to think about

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Jacob Kaplan-Moss
I'm with Steve:: {% for %} ... {% default %} .. {% endfor %} ... seems best. Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to

Status on Django and Python 3.0.

2008-10-29 Thread Graham Dumpleton
Back in March in the thread: http://groups.google.com/group/django-developers/browse_frm/thread/d0922f1d56b09a4c Martin v. Löwis indicated he had made an attempt at getting 2to3 to work on Django to see how it would work under Python 3.0. From that various bits of code were identified in

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Steve Holden
Calvin Spealman wrote: > On Wed, Oct 29, 2008 at 9:48 PM, Dave Smith <[EMAIL PROTECTED] > > wrote: > > I'm wondering who that's going to confuse. It's very clear that > the template language > isn't Python, so I'd think it'd make the most sense to use a >

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Calvin Spealman
On Wed, Oct 29, 2008 at 9:48 PM, Dave Smith <[EMAIL PROTECTED]> wrote: > I'm wondering who that's going to confuse. It's very clear that the > template language > isn't Python, so I'd think it'd make the most sense to use a keyword that > makes sense > within the context of the template language.

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Dave Smith
I'm wondering who that's going to confuse. It's very clear that the template language isn't Python, so I'd think it'd make the most sense to use a keyword that makes sense within the context of the template language. I'd think that either 'else' or 'ifnone' are the most memorable/readable.

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Ned Batchelder
Yes, you are right! --Ned. Calvin Spealman wrote: > The else clause executes unless a loop is broken (that is, with the > break or obviously by raising an exception), and executes after a loop > ends normally. > > >>> for i in "abc": > ... pass > ... else: > ... print "else" > else > >>> >

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Calvin Spealman
The else clause executes unless a loop is broken (that is, with the break or obviously by raising an exception), and executes after a loop ends normally. >>> for i in "abc":... pass ... else: ... print "else" else >>> On Wed, Oct 29, 2008 at 8:32 PM, Ned Batchelder <[EMAIL PROTECTED]>wrote:

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Ned Batchelder
But this does operate the same as the Python for/else, no? >>> for i in []: ... print "boo" ... else: ... print "foo" ... foo >>> --Ned. http://nedbatchelder.com Calvin Spealman wrote: > On Tue, Oct 28, 2008 at 8:18 PM, oggie rob <[EMAIL PROTECTED] >

Re: Arbitrary objects in urlconf

2008-10-29 Thread [EMAIL PROTECTED]
You can already do what your proposal would allow in middleware as seen here: http://www.b-list.org/weblog/2007/nov/06/urlconf/ On Oct 29, 1:31 pm, Ludvig Ericson <[EMAIL PROTECTED]> wrote: > On Oct 29, 2008, at 18:23, Ludvig Ericson wrote:> class MyTest(object): > >     def resolve(self,

Re: Arbitrary objects in urlconf

2008-10-29 Thread Ludvig Ericson
On Oct 29, 2008, at 18:23, Ludvig Ericson wrote: > class MyTest(object): > def resolve(self, request, path): > if request.get_host().is_very_nice(): > urlconf = x1 > else: > urlconf = x2 > return x2.resolve_and_stuff(request, path, ...) 'Course

Arbitrary objects in urlconf

2008-10-29 Thread Ludvig Ericson
Hey, I think something like this was brought up before, for another reason and Malcolm said he put arbitrary objects into urlconfs to tailor needs for clients. As it happens, I have the following setup: foo.com - my main site, where you'd find /accounts/login/ etc. user.foo.com - personal

Re: Proposal: Set minimum MySQL version for Django 1.0

2008-10-29 Thread Adam Nelson
Sounds good - thanks for sending that over. I looked high and low for that document and couldn't find it. I'll make suggestions in a documentation ticket. Regards, Adam On Tue, Oct 28, 2008 at 7:34 PM, Russell Keith-Magee <[EMAIL PROTECTED] > wrote: > > On Wed, Oct 29, 2008 at 1:29 AM, Adam

Re: Proposal: ordering edit-inlines with order_with_respect_to (admin-interface)

2008-10-29 Thread patrickk
thanks, jacob. doing the OrderingField doesn´t seem too much or a problem (and I do like the idea of getting rid of order_with_respect_to). where I´m really struggeling is the admin-interface: let´s say I have changed the order of my inline-related forms, I´ve made an error (e.g. a required

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Ivan Sagalaev
Jannis Leidel wrote: > The proposed feature would allow this: > > {% for item in grocery_list %} > {{ item }} > {% default %} > Nothing to buy. > {% endfor %} As of coloring the bikeshed, I prefer {% empty %} over {% default %} and {% else %}.