Re: Django template 'if ... is' feature design

2016-04-14 Thread Stephen Kelly
Sven R. Kunze wrote: > Good evening everybody. That's my first post here, so let's how this > works. :) > > This particular discussion caught my sight as it might introduce something > really "low-level" functionality into the template engine. As far as I understand from https://github.com/dja

Re: Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Carl Meyer wrote: > No to tests, because we would be adding tests for undefined and > unreliable behavior. Yes, makes sense. Thanks again for the explanation. > It might be worth adding a short documentation note. We largely want to > avoid documenting Python's behavior in the Django docs, but a

Re: Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Carl Meyer wrote: > The point is that you shouldn't ever expect any consistent behavior when > using `is` with strings (whether in Python code or in Django templates), > because that behavior is not defined by the Python language, it's > implementation dependent. It happens that the CPython implem

Re: Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Ryan Hiebert wrote: >> * What should work / what should not work? Is the documentation clear? > > I don't know about the docs, but it _does_ work exactly like the Python > version. I suppose you are not responding to what you quoted. Anyway, that makes at least two people telling me that

Re: Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Stephen Kelly wrote: > * The unit tests added both have the same name ("template"). They should > have different names of the form 'if-tag-isNN' FYI, I made a pull request which fixes this and some other minor issues in the if-tag tests: https://github.com/django

Re: Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Daniel Chimeno wrote: > I think we should give an emphasis on this because are going to cause > problems to some people. Yes, this is why I suggested in my original mail that the feature needs more design consideration. * What should work / what should not work? Is the documentation clear?

Re: Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Ryan Hiebert wrote: > The `is` operator in Python checks for identical objects. A string is not > guaranteed to be exactly the same object as another string (in this > example "True" is not the same object (bytes in memory) as the second > "True", so Python rightly sees that they are not the same

Django template 'if ... is' feature design

2016-04-07 Thread Stephen Kelly
Hello, I reviewed https://github.com/django/django/commit/c00ae7f5 while updating the features of Grantlee, and I have the following notes: * The unit tests added both have the same name ("template"). They should have different names of the form 'if-tag-isNN' * The feature does not work th

Re: Newline stripping in templates: the dnl way

2012-06-28 Thread Stephen Kelly
Leon Matthews wrote: > On 2 March 2012 09:45, Carl Meyer > wrote: >> Same reason any ticket stalls - it seems that nobody felt strongly >> enough about it to put the time into reviewing and thoroughly testing >> the patch and marking it Ready for Checkin. If you'd like to see it in >> (post 1.4 a

Re: Reversing translated urls in templates

2011-07-05 Thread Stephen Kelly
Jannis Leidel wrote: > > On 05.07.2011, at 09:26, Jonathan Slenders wrote: > >> I'm also +1 on {% language lang_code %}... {% endlanguage %} >> >> We are using exactly this template tag for maybe about half a year >> already. Not for i18n urls, but for formatting numbers. The decimal >> separat

Re: DDN: #2594 (Template system whitespace) may cause blocktrans issue

2011-04-20 Thread Stephen Kelly
Jonathan Slenders writes: > > Some concerns, even if I don't know much about the subject. > > Are you sure that it's always appropriate to strip indentation? I didn't say anything about 'always' :) -- You received this message because you are subscribed to the Google Groups "Django develop

DDN: #2594 (Template system whitespace) may cause blocktrans issue

2011-04-17 Thread Stephen Kelly
Hi, I posted this before but I think people had the 1.3 release on the brain, so now that's out (congrats :)), I'm trying again: http://thread.gmane.org/gmane.comp.python.django.devel/30752 ** copied content ** #2594 is now ready for checkin as far as I can tell for the 1.4 milestone (I under

Re: Comments no longer possible on djangobook.com?

2011-04-17 Thread Stephen Kelly
Alex Gaynor wrote: > Hi Steve, > > The DjangoBook is not part of the Django Project itself, so this isn't > really the right place to report a bug with it: > http://djangobook.com/contact/ is the appropriate way to try and get into > contact with the authors. Ok done, thanks. > > Alex > --

Comments no longer possible on djangobook.com?

2011-04-17 Thread Stephen Kelly
Hi, I think someone here runs that site. Are the comments all gone or am I missing something? Thanks, Steve. -- 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 u

Re: Various small issues

2011-01-31 Thread Stephen Kelly
Klaas van Schelven wrote: > Hi all, > > Maybe I wasn't clear enough last time... I've provided patches for > both these old problems and would appreciate either a brutal Linus > style rant for being such an idiot or would like to see the patches > applied. Silence... not so much. > Hi Klass, Y

DDN: #2594 (Template system whitespace) may cause blocktrans issue

2011-01-23 Thread Stephen Kelly
Hi, #2594 is now ready for checkin as far as I can tell for the 1.4 milestone (I understand 1.3 is closed), with one side-issue. http://code.djangoproject.com/ticket/2594 The side issue is that msgids in the .po file extracted with makemessages will not match the untranslated string that Djang

DDN: Localize anything with _(this_syntax) ?

2010-11-11 Thread Stephen Kelly
Hi, Currently strings in templates can be translated with {{ _("foo") }} syntax. Localizing values can be done with a filter {{ foo|localize }}. I have a patch to allow localizing localizable values like {{ _(foo) }}, which I think is more convenient. It sort of mixes up the meaning of _() to

Re: Receipt for mail to security@ ?

2010-11-10 Thread Stephen Kelly
Jacob Kaplan-Moss wrote: > On Wed, Nov 10, 2010 at 1:39 PM, Stephen Kelly > wrote: >> Can someone confirm that the email I sent yesterday made it through? Last >> time I emailed that list it was marked as spam apparently. > > Yes, we've got it. We'll get b

Receipt for mail to security@ ?

2010-11-10 Thread Stephen Kelly
Hi, Can someone confirm that the email I sent yesterday made it through? Last time I emailed that list it was marked as spam apparently. All the best, Steve. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send em

Re: custom function for autoescape

2010-11-08 Thread Stephen Kelly
Hi, Sorry I'm late to this thread. I've been working hard on i18n. Luke Plant wrote: > Logically I would expect the following 3 to produce the same output: > > 1) I use mark_safe on my safe input string and use addslashes to add > the slashes > > Template("{{ val|addslashes }}").render( > Conte

Re: Feature proposal: escape hatch for colliding template syntax in django templates

2010-10-19 Thread Stephen Kelly
Stephen Kelly wrote: > Stephen Kelly wrote: > >> Łukasz Rekucki wrote: >> >>> On 19 October 2010 23:41, Jacob Kaplan-Moss >>> wrote: >>>> On Tue, Oct 19, 2010 at 4:31 PM, James Bennett >>>> wrote: >>>>> If we&#x

Re: Feature proposal: escape hatch for colliding template syntax in django templates

2010-10-19 Thread Stephen Kelly
Stephen Kelly wrote: > Łukasz Rekucki wrote: > >> On 19 October 2010 23:41, Jacob Kaplan-Moss >> wrote: >>> On Tue, Oct 19, 2010 at 4:31 PM, James Bennett >>> wrote: >>>> If we're going to do this, could we also look at deprecating the >

Re: Feature proposal: escape hatch for colliding template syntax in django templates

2010-10-19 Thread Stephen Kelly
Łukasz Rekucki wrote: > On 19 October 2010 23:41, Jacob Kaplan-Moss > wrote: >> On Tue, Oct 19, 2010 at 4:31 PM, James Bennett >> wrote: >>> If we're going to do this, could we also look at deprecating the >>> 'templatetag' template tag? There are a couple cases a 'verbatim' tag >>> wouldn't cov

Re: How to get patches from 'Accepted' to 'Committed'

2010-08-04 Thread Stephen Kelly
Jacob Kaplan-Moss wrote: > A polite nag on the mailing list -- like this email -- is a perfect > way to prod things along. > Cool, thanks for committing those. All the best, Steve. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To pos

How to get patches from 'Accepted' to 'Committed'

2010-08-03 Thread Stephen Kelly
Hi, The diagram here shows the lifecycle of a ticket. http://docs.djangoproject.com/en/dev/internals/contributing/#ticket-triage What I don't get is how a ticked goes from 'Accepted' to 'Ready for checkin' The context I ask in is in relation to patches I submitted a year ago and which were acc

Grantlee version 0.1.0 now available

2010-04-12 Thread Stephen Kelly
The Grantlee community is pleased to announce the availability of Grantlee version 0.1.0[1]. Grantlee is a Free Software string template library written in Qt and based on the syntax and design of the Django template system[2]. Django's template system is designed to separate content and presentat

Re: NDjango - .Net port of Django template langauage

2009-09-23 Thread Stephen Kelly
in a single hole? which one goes? The first? the last? > all of them? Nested block definition is ok when we define a 'hole', > but when we define a new value to be placed in a hole it creates > ambiguity for which I do not see any real use. > > On Sep 23, 2:22 pm, Stephen Kel

Re: NDjango - .Net port of Django template langauage

2009-09-23 Thread Stephen Kelly
Michael Feingold wrote: > On Sep 23, 2:54 am, Pablo Escobar > wrote: >> 1. Django is Open Source. It is not a problem to find the parsing >> algorithm >> > Of course it is And we did go through the code. But reverse > engineering can show you what happens, not what the intention was Usually the