Hello,

I am trying to assign max_value and min_value to a
PositiveIntegerField in my model but am getting the error:

year_built = models.PositiveIntegerField(min_value=1800,
max_value=2100)
TypeError: __init__() got an unexpected keyword argument 'max_value'

Here is the model:

from django.db import models
from django.forms import ModelForm

floor_plan_choices = (
        ('A', 'Square'),
        ('B', 'Rectangular'),
        ('C', 'Round'),
)

direction_choices = (
        ('360', '360'),
        ('270', '270'),
        ('180', '180'),
        ('90', '90'),
)

class Customer(models.Model):
        date_stamp = models.DateTimeField(auto_now_add=True)
        order_number = models.PositiveIntegerField(editable=False)
        first_name = models.CharField(max_length=30)
        last_name = models.CharField(max_length=40)
        email = models.EmailField()
        email_conf = models.EmailField(verbose_name='Confirm Email')
        year_built = models.PositiveIntegerField(min_value=1800,
max_value=2100)
        period = models.PositiveIntegerField(editable=False)
        direction = models.DecimalField(max_digits=5, decimal_places=2,
choices=direction_choices)
        floor_plan = models.CharField(max_length=2,
choices=floor_plan_choices)

class CustomerForm(ModelForm):

        class Meta:
                model = Customer

def __unicode__(self):
        return u'%s %s' % (self.first_name, self.last_name)

Can anyone explain to me what I am doing wrong and how I should be
assigning max and min values?
--~--~---------~--~----~------------~-------~--~----~
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 from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to