Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- area = forms.DecimalField(max_digits=20)
- raise Exception(type(a.get('area',))
- float(a.get('area', '0'))
- area = form.data['area']
- #area should be <type 'unicode'>
- area_float = float(area)
- a = u'1.34'
- a_float = float(a)
- type(a_float)
- >> <type 'float'>
- if form.is_valid():
- # Form is valid, so do stuff with the form data
- # e.g. send email, save to DB etc.
- area = form.cleaned_data['area']
- # more code here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement