Re: [Django] #11496: max_value validation is inconsistant

2010-12-28 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Documentation   |   Version:  SVN  
Resolution:  |  Keywords:  max_value
 Stage:  Accepted| Has_patch:  1
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by timo):

  * component:  Forms => Documentation

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11496: max_value validation is inconsistant

2010-11-16 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Forms   |   Version:  SVN  
Resolution:  |  Keywords:  max_value
 Stage:  Accepted| Has_patch:  1
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by adamv):

  * has_patch:  0 => 1
  * version:  1.0 => SVN

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11496: max_value validation is inconsistant

2010-02-02 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Forms   |   Version:  1.0  
Resolution:  |  Keywords:  max_value
 Stage:  Accepted| Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by russellm):

  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11496: max_value validation is inconsistant

2009-12-31 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Forms   |   Version:  1.0  
Resolution:  |  Keywords:  max_value
 Stage:  Unreviewed  | Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Comment (by empty):

 The issue here is that the docs are not clear that max_value needs to be
 declared as a Decimal type.  So the OP should specify it like:


 {{{
 import decimal

 amount =
 
forms.DecimalField(max_digits=8,decimal_places=2,max_value=decimal.Decimal('59.99'))
 }}}

 The appropriate thing to do here is to correct the docs, or should I say
 actually document the use.  But even better to just handle the conversion
 in Django so the developer can specify it either way.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #11496: max_value validation is inconsistant

2009-07-19 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Forms   |   Version:  1.0  
Resolution:  |  Keywords:  max_value
 Stage:  Unreviewed  | Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Comment (by anonymous):

 TYPE_CHOICES = (
 ('T','Today Only'),
 ('P','Permanent'),
 ('B','Both Today and Permanent')
 )

 class Batch(models.Model):
 submit_date = models.DateTimeField('Batch Time')
 user = models.CharField(max_length=25)
 amount = models.DecimalField(max_digits=8,decimal_places=2)
 type = models.CharField(max_length=1,choices=TYPE_CHOICES,default='T')
 class Meta:
 ordering = ['-submit_date']

 class Amount(models.Model):
 value = models.DecimalField(max_digits=8,decimal_places=2)

 class BatchForm(ModelForm):
 amount = forms.DecimalField(max_digits=8,decimal_places=2)
 class Meta:
 model = Batch
 exclude = ('submit_date','user')

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #11496: max_value validation is inconsistant

2009-07-19 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Forms   |   Version:  1.0  
Resolution:  |  Keywords:  max_value
 Stage:  Unreviewed  | Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Comment (by anonymous):

 Replying to [comment:2 kmtracey]:
 > Removing milestone as an unconfirmed problem should not block a bug-fix
 release.  As for investigating this -- there's not enough information here
 to recreate as the Batch model upon which your model form is based is
 missing.  Also you say "sometimes" you encounter this problem, so I'm
 guessing even with full information it will be hard to recreate.  The code
 involved here is in django/forms/fields.py and the case where this error
 message is raised is straightforward:
 >
 > {{{
 > #!python
 > if self.max_value is not None and value > self.max_value:
 > raise ValidationError(self.error_messages['max_value'] %
 self.max_value)
 > }}}
 >
 > As a first step I would probably change that error message and the code
 here that constructs it to also print the value being tested against, as
 that might give a clue what has gone wrong in the cases where you are
 seeing the problem.
 >

 Sometimes was a definite understatement.  I am able to reproduce within 10
 submits of my form.  I have removed that validation from the code and am
 now validating through the view itself.

 From views.py

 def processBatchForm(request):
 if request.method == 'POST':
 form = BatchForm(request.POST)
 message = ""
 if form.is_valid():

 ...

 else:
 message = message + "Data Validation Error!  Please see
 errors."

 prev_batches = Batch.objects.all()[:10]
 live_val = getBatchValue();
 return render_to_response('refunds/batch_list.html', {
 'form': form,
 'batch_history': prev_batches,
 'live_val' : live_val,
 'message' : message,
 'user' : request.user
 })
 else:
 print "Request Method not permitted."


 from

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #11496: max_value validation is inconsistant

2009-07-19 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Forms   |   Version:  1.0  
Resolution:  |  Keywords:  max_value
 Stage:  Unreviewed  | Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by kmtracey):

  * milestone:  1.0.3 =>

Comment:

 Removing milestone as an unconfirmed problem should not block a bug-fix
 release.  As for investigating this -- there's not enough information here
 to recreate as the Batch model upon which your model form is based is
 missing.  Also you say "sometimes" you encounter this problem, so I'm
 guessing even with full information it will be hard to recreate.  The code
 involved here is in django/forms/fields.py and the case where this error
 message is raised is straightforward:

 {{{
 #!python
 if self.max_value is not None and value > self.max_value:
 raise ValidationError(self.error_messages['max_value'] %
 self.max_value)
 }}}

 As a first step I would probably change that error message and the code
 here that constructs it to also print the value being tested against, as
 that might give a clue what has gone wrong in the cases where you are
 seeing the problem.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #11496: max_value validation is inconsistant

2009-07-17 Thread Django
#11496: max_value validation is inconsistant
-+--
  Reporter:  bobbo...@gmail.com  | Owner:  nobody   
Status:  new | Milestone:  1.0.3
 Component:  Forms   |   Version:  1.0  
Resolution:  |  Keywords:  max_value
 Stage:  Unreviewed  | Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by ubernostrum):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> I am attempting to use validation in the following modelform:
>
> class BatchForm(ModelForm):
> amount =
> forms.DecimalField(max_digits=8,decimal_places=2,max_value=59.99)
> class Meta:
> model = Batch
> exclude = ('submit_date','user')
>
> Sometimes is_valid() returns true and sometimes it returns false with the
> amount 1212.
>
> The error returnedis:
>
> Ensure this value is less than or equal to 59.99.
>
> Is this a know issue?
>
> Version Django-1.0.2-final Python 2.5.1 Mac OSX 10.5.7

New description:

 I am attempting to use validation in the following modelform:

 {{{
 class BatchForm(ModelForm):
 amount =
 forms.DecimalField(max_digits=8,decimal_places=2,max_value=59.99)
 class Meta:
 model = Batch
 exclude = ('submit_date','user')
 }}}

 Sometimes is_valid() returns true and sometimes it returns false with the
 amount 1212.

 The error returnedis:

 Ensure this value is less than or equal to 59.99.

 Is this a know issue?

 Version Django-1.0.2-final Python 2.5.1 Mac OSX 10.5.7

Comment:

 (formatting)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



[Django] #11496: max_value validation is inconsistant

2009-07-16 Thread Django
#11496: max_value validation is inconsistant
+---
 Reporter:  bobbo...@gmail.com  |   Owner:  nobody
   Status:  new |   Milestone:  1.0.3 
Component:  Forms   | Version:  1.0   
 Keywords:  max_value   |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 I am attempting to use validation in the following modelform:

 class BatchForm(ModelForm):
 amount =
 forms.DecimalField(max_digits=8,decimal_places=2,max_value=59.99)
 class Meta:
 model = Batch
 exclude = ('submit_date','user')

 Sometimes is_valid() returns true and sometimes it returns false with the
 amount 1212.

 The error returnedis:

 Ensure this value is less than or equal to 59.99.

 Is this a know issue?

 Version Django-1.0.2-final Python 2.5.1 Mac OSX 10.5.7

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---