Re: More standard template filters

2020-02-01 Thread Fran Hrženjak
A similar ticket from 6 years ago (with some more filters) was closed as a wontfix: https://code.djangoproject.com/ticket/22162 Unless there was a change in the phylosiphy, I don’t think this will be accepted either (I don’t have an opinion about whether it shouldbe, though leaning towards

Re: More standard template filters

2020-02-01 Thread keshav kumar
So, can I create as a new feature and start working on it ? On Wednesday, 29 January 2020 22:36:09 UTC+5:30, Collin Anderson wrote: > > I think it would be helpful to have builtin startswith, endswith and > contains filters. > > On Thursday, January 23, 2020 at 4:40:32 PM UTC-5, keshav kumar

Re: More standard template filters

2020-01-29 Thread Collin Anderson
I think it would be helpful to have builtin startswith, endswith and contains filters. On Thursday, January 23, 2020 at 4:40:32 PM UTC-5, keshav kumar wrote: > > There are already filters which works on advance logic. for example :- > 'join'. So, is it not good to add filter for startswith,

Re: More standard template filters

2020-01-23 Thread keshav kumar
There are already filters which works on advance logic. for example :- 'join'. So, is it not good to add filter for startswith, endswith and contains as well? On Friday, 5 April 2019 14:46:53 UTC+5:30, Adam Johnson wrote: > > FYI Jinja2 allows (most) python expressions, so this would Just

Re: More standard template filters

2019-04-05 Thread Curtis Maloney
On 4/5/19 8:16 PM, Adam Johnson wrote: FYI Jinja2 allows (most) python expressions, so this would Just Work(TM): {{  myvar.startswith("x") }} Django Template Language has a lot of legacy that prevents this from happening, afaiu it would not be possible to move to it. For "legacy" read

Re: More standard template filters

2019-04-05 Thread Adam Johnson
FYI Jinja2 allows (most) python expressions, so this would Just Work(TM): {{ myvar.startswith("x") }} Django Template Language has a lot of legacy that prevents this from happening, afaiu it would not be possible to move to it. It's not hard to move your templates (asides from those extending

Re: More standard template filters

2019-04-05 Thread Curtis Maloney
On 4/5/19 3:06 AM, Collin Anderson wrote: Hi All, I use django templates a lot and I always wished there was a myvar|startswith:"teststring", myvar|endswith:"teststring" and a myvar|contains:"teststring" filter. It's almost like we need a syntax for calling methods with an argument, just

More standard template filters

2019-04-04 Thread Collin Anderson
Hi All, I use django templates a lot and I always wished there was a myvar|startswith:"teststring", myvar|endswith:"teststring" and a myvar|contains:"teststring" filter. I instead do stuff like myvar|slice:":10" == "teststring" which is a total hack. Is this something that could be simple