Monday, May 25, 2015

Re: How to use unlocalize in views

Thank You Luis, but it will be for the entire project, right? I just want to apply this to a single variable.

For example,

(float)
variable_x = 15.123  # Thousand separator from my L10N

variable_y = unlocalize(variable_x) 
print variable_y  # 15123

Do you know how can I do that without using a global directive?

Em segunda-feira, 25 de maio de 2015 11:53:50 UTC-3, luisza14 escreveu:
Set in yours Settings

USE_I18N = False

USE_L10N = False

See:
https://docs.djangoproject.com/en/1.8/ref/settings/#use-i18n

2015-05-25 7:01 GMT-06:00 <julio....@m2agro.com.br>:
Hello guys!

Is there a way to use unlocalize in views? I know that I can use this in template (https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#localize)

--
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 to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/767e0d4e-9671-4363-a09c-1e67839994cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


--
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 to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fc283125-69f7-4124-a96c-69c0c2d48223%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment