Explicitly mark some CharField as non blank

This commit is contained in:
Oliver Walters 2019-05-04 17:00:33 +10:00
parent 1d9e31c229
commit 4ef1e4fc78
4 changed files with 15 additions and 5 deletions

View File

@ -23,9 +23,16 @@ class InvenTreeTree(models.Model):
abstract = True abstract = True
unique_together = ('name', 'parent') unique_together = ('name', 'parent')
name = models.CharField(max_length=100, unique=True) name = models.CharField(
blank=False,
max_length=100,
unique=True
)
description = models.CharField(max_length=250) description = models.CharField(
blank=False,
max_length=250
)
# When a category is deleted, graft the children onto its parent # When a category is deleted, graft the children onto its parent
parent = models.ForeignKey('self', parent = models.ForeignKey('self',

View File

@ -87,7 +87,10 @@ class Build(models.Model):
limit_choices_to={'buildable': True}, limit_choices_to={'buildable': True},
) )
title = models.CharField(max_length=100, help_text='Brief description of the build') title = models.CharField(
blank=False,
max_length=100,
help_text='Brief description of the build')
quantity = models.PositiveIntegerField( quantity = models.PositiveIntegerField(
default=1, default=1,

View File

@ -42,7 +42,7 @@ class Company(models.Model):
It may be a supplier or a customer (or both). It may be a supplier or a customer (or both).
""" """
name = models.CharField(max_length=100, unique=True, name = models.CharField(max_length=100, blank=False, unique=True,
help_text='Company name') help_text='Company name')
description = models.CharField(max_length=500) description = models.CharField(max_length=500)

View File

@ -390,7 +390,7 @@ class StockItemTracking(models.Model):
date = models.DateTimeField(auto_now_add=True, editable=False) date = models.DateTimeField(auto_now_add=True, editable=False)
# Short-form title for this tracking entry # Short-form title for this tracking entry
title = models.CharField(max_length=250) title = models.CharField(blank=False, max_length=250)
# Optional longer description # Optional longer description
notes = models.TextField(blank=True) notes = models.TextField(blank=True)