Thursday, April 5, 2012

Re: Comma as decimal field

I assume that your problem is that when the data is posted , the ORM when submitting it to the database throws the eror.

You need to  place the posted value into a variable and use a python replace statement to replace the , with a period.

Not sure what type of validation that you are using.

Putting aside any sort of validation on the number.

new_number=request.post(variable_coming_in)

number=new_number.replace(" ,  " , "  . ")

Then the database won't complain



On Thursday, April 5, 2012 10:27:40 PM UTC-4, ydjango wrote:
What is best way to allow users to enter decimal either as "." or as
",'?
Currently if user enter "," django forms throw error.

I cannot change settings file based on user as same app serves users
worldwide.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/3d4h2YB5Y5MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate