Decreased max_length for char fields unless absolutely needed. (#8485)
This commit is contained in:
parent
60f5129076
commit
d611a89238
|
@ -76,11 +76,11 @@ class ItemAndSimpleItem(models.Model):
|
|||
|
||||
|
||||
class Profile(models.Model):
|
||||
profile1 = models.CharField(max_length=1000, default='profile1')
|
||||
profile1 = models.CharField(max_length=255, default='profile1')
|
||||
|
||||
|
||||
class Location(models.Model):
|
||||
location1 = models.CharField(max_length=1000, default='location1')
|
||||
location1 = models.CharField(max_length=255, default='location1')
|
||||
|
||||
|
||||
class Request(models.Model):
|
||||
|
@ -88,10 +88,10 @@ class Request(models.Model):
|
|||
location = models.ForeignKey(Location, models.CASCADE)
|
||||
items = models.ManyToManyField(Item)
|
||||
|
||||
request1 = models.CharField(default='request1', max_length=1000)
|
||||
request2 = models.CharField(default='request2', max_length=1000)
|
||||
request3 = models.CharField(default='request3', max_length=1000)
|
||||
request4 = models.CharField(default='request4', max_length=1000)
|
||||
request1 = models.CharField(default='request1', max_length=255)
|
||||
request2 = models.CharField(default='request2', max_length=255)
|
||||
request3 = models.CharField(default='request3', max_length=255)
|
||||
request4 = models.CharField(default='request4', max_length=255)
|
||||
|
||||
|
||||
class Base(models.Model):
|
||||
|
|
|
@ -83,7 +83,7 @@ class ArticleTranslation(models.Model):
|
|||
lang = models.CharField(max_length=2)
|
||||
title = models.CharField(max_length=100)
|
||||
body = models.TextField()
|
||||
abstract = models.CharField(max_length=400, null=True)
|
||||
abstract = models.TextField(null=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('article', 'lang')
|
||||
|
|
|
@ -39,7 +39,7 @@ DoesNotExistBookManager = BaseManager.from_queryset(DoesNotExistQuerySet)
|
|||
|
||||
|
||||
class Book(models.Model):
|
||||
name = models.CharField(max_length=300)
|
||||
name = models.CharField(max_length=255)
|
||||
slug = models.SlugField()
|
||||
pages = models.IntegerField()
|
||||
authors = models.ManyToManyField(Author)
|
||||
|
@ -57,7 +57,7 @@ class Book(models.Model):
|
|||
|
||||
class Page(models.Model):
|
||||
content = models.TextField()
|
||||
template = models.CharField(max_length=300)
|
||||
template = models.CharField(max_length=255)
|
||||
|
||||
|
||||
class BookSigning(models.Model):
|
||||
|
|
|
@ -29,7 +29,7 @@ class Tag(models.Model):
|
|||
|
||||
|
||||
class Thing(models.Model):
|
||||
name = models.CharField(max_length=256)
|
||||
name = models.CharField(max_length=255)
|
||||
tags = models.ManyToManyField(Tag)
|
||||
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ class WhizIterEmpty(models.Model):
|
|||
|
||||
|
||||
class BigD(models.Model):
|
||||
d = models.DecimalField(max_digits=38, decimal_places=30)
|
||||
d = models.DecimalField(max_digits=32, decimal_places=30)
|
||||
|
||||
|
||||
class FloatModel(models.Model):
|
||||
|
|
|
@ -193,7 +193,7 @@ class MessyBachelorParty(BachelorParty):
|
|||
|
||||
# Check concrete -> abstract -> concrete inheritance
|
||||
class SearchableLocation(models.Model):
|
||||
keywords = models.CharField(max_length=256)
|
||||
keywords = models.CharField(max_length=255)
|
||||
|
||||
|
||||
class Station(SearchableLocation):
|
||||
|
|
|
@ -2,4 +2,4 @@ from django.db import models
|
|||
|
||||
|
||||
class Person(models.Model):
|
||||
name = models.CharField(max_length=256)
|
||||
name = models.CharField(max_length=255)
|
||||
|
|
Loading…
Reference in New Issue