Changes between Initial Version and Version 1 of Ticket #26131
- Timestamp:
- Jan 24, 2016, 9:28:35 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26131 – Description
initial v1 1 1 In Django 1.8.8 when I create a model class like below, choices are not enforced when creating an instance of the model class: 2 2 3 class HTTPMethod(models.Model):4 HTTP_METHODS = [(_, _) for _ in ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace', 'connect']]3 class HTTPMethod(models.Model): 4 HTTP_METHODS = [(_, _) for _ in ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace', 'connect']] 5 5 6 id = models.AutoField(primary_key=True)7 name = models.CharField(choices=HTTP_METHODS, unique=True, max_length=255)6 id = models.AutoField(primary_key=True) 7 name = models.CharField(choices=HTTP_METHODS, unique=True, max_length=255) 8 8 9 9 10 h = HTTPMethod(name='something invalid')11 h.save()10 h = HTTPMethod(name='something invalid') 11 h.save() 12 12 13 13 No errors are raised.