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