Try using django-mathfilters.
https://pypi.org/project/django-mathfilters/
On Wed, Dec 18, 2019, 11:55 PM Adeotun Adegbaju
wrote:
> you should indicate which files codes should be added to
>
> On Tuesday, November 18, 2008 at 11:21:09 PM UTC+1, Daniel Roseman wrote:
>>
>> On Nov 18, 7:55 pm, ja
you should indicate which files codes should be added to
On Tuesday, November 18, 2008 at 11:21:09 PM UTC+1, Daniel Roseman wrote:
>
> On Nov 18, 7:55 pm, jago wrote:
> > I am thinking about something like {{ (width - 5) *12 }} ?
>
> No. You can add or subtract using the 'add' filter:
> {{
On Nov 18, 7:55 pm, jago <[EMAIL PROTECTED]> wrote:
> I am thinking about something like {{ (width - 5) *12 }} ?
No. You can add or subtract using the 'add' filter:
{{ width:add:"-5" }}
but anything else will require a custom template tag or filter.
Luckily, these are extremely easy to write:
You can do it in a custom eval-like tag:
@register.tag()
def evalpy(parser, token):
try:
tag_name, expression = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError, "%r tag requires a
single argument" % token.contents.split(
> I am thinking about something like {{ (width - 5) *12 }} ?
No. That syntax is not supported in Django templates.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
I am thinking about something like {{ (width - 5) *12 }} ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe fro
6 matches
Mail list logo