On 28/03/2012, at 3:51 AM, Ian Kelly wrote: > On Tue, Mar 27, 2012 at 1:26 PM, gs412 <gs...@126.com> wrote: >> Less symbol is the tide, the future. for example: >> coffeescript、sass、haml、slim and python, there are all less symbol, this >> feature make developer fell well > > This is incorrect. If Python were all about "fewer symbols", then we > would favor tabs over spaces, we would not require colons at the ends > of block-starting lines, and we would have operators like "!" instead > of "not". > > One of the goals of Python is to be *more readable*, not to be > unnecessarily terse. > >> passing context variables for tag "url" is not a good idea, it make the work >> from easy to hard >>> >>> {% with url_name="client-detail-view" %} >>> {% url url_name client.id %} >>> {% endwith %} >> >> >> three lines instead of one lines, just for passing context variables, >> context variables for url is not widespread > > You don't need three lines. There is no reason that the following > shouldn't work, so if it doesn't, then that is something that ought to > be fixed. > > {% url "client-detail-view" client.id %} > > This syntax has been available since Django 1.3, which was released a > year ago. If Django 1.5 takes the same amount of time that 1.4 did, > then it is still another year away. That is two full years to bring > your templates up-to-date, and it is a simple enough change that you > could probably do it with a short script.
It should also be added that since Django 1.3, you've been able to put {% load url from future %} at the top of your templates, which allows you to cleanly introduce the use of the new tag into your templates. This was also documented in the release notes for Django 1.3. To the original poster -- thanks for the suggestion, but no, this isn't going to be reverted. Ironically, your "3 line" example points out exactly why the change has been made -- it allows you to use a variable to be used as your URL name, whereas the unquoted behavior requires that your url is a known, static string. Without the new behavior of the URL tag, you wouldn't be able to use the URL tag with a value set in a with tag. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.