Re: Using hashids in django template

2016-08-18 Thread Paul Aswa
Thanks for the shedding light on filters, really helpful. I should have thought about that! On Thursday, August 18, 2016 at 8:46:22 PM UTC+3, ludovic coues wrote: > > Filter are a way to apply a function to a value in a django template. > > The filter would look like that: > > def hashid(va

Re: Using hashids in django template

2016-08-18 Thread ludovic coues
Filter are a way to apply a function to a value in a django template. The filter would look like that: def hashid(value): return hashids.encode(value) and your template like that: {{ id|hashid }} I omitted some part that are in the doc, like making the filter available in your

Re: Using hashids in django template

2016-08-18 Thread Paul Aswa
Being a newbie to python and django, this seems to be giving me problems On Thursday, August 18, 2016 at 2:57:56 PM UTC+3, ludovic coues wrote: > > You might be looking for this > https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/ > > 2016-08-18 12:57 GMT+02:00 Paul Aswa >: > >

Re: Using hashids in django template

2016-08-18 Thread ludovic coues
You might be looking for this https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/ 2016-08-18 12:57 GMT+02:00 Paul Aswa : > Is there means of encoding an id using hashids in django templates? > > -- > You received this message because you are subscribed to the Google Groups > "Django

Using hashids in django template

2016-08-18 Thread Paul Aswa
Is there means of encoding an id using hashids in django templates? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email