Skip to content

Commit

Permalink
Merge pull request #232 from classy-python/remove-form-logic-from-models
Browse files Browse the repository at this point in the history
Remove "blank=True" from fields
  • Loading branch information
meshy authored May 19, 2024
2 parents 765ae15 + b1737e4 commit 8894a34
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions cbv/migrations/0010_auto_20230104_0019.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 3.1.14 on 2023-01-04 00:19

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [("cbv", "0009_move_unique_constraint")]

operations = [
migrations.AlterField(
model_name="klass",
name="docstring",
field=models.TextField(default=""),
),
migrations.AlterField(
model_name="method",
name="docstring",
field=models.TextField(default=""),
),
migrations.AlterField(
model_name="module",
name="docstring",
field=models.TextField(default=""),
),
migrations.AlterField(
model_name="projectversion",
name="sortable_version_number",
field=models.CharField(max_length=200),
),
]
8 changes: 4 additions & 4 deletions cbv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ProjectVersion(models.Model):
"""Represents a particular version of a project in a python project hierarchy"""

version_number = models.CharField(max_length=200)
sortable_version_number = models.CharField(max_length=200, blank=True)
sortable_version_number = models.CharField(max_length=200)

objects = ProjectVersionManager()

Expand Down Expand Up @@ -66,7 +66,7 @@ class Module(models.Model):

project_version = models.ForeignKey(ProjectVersion, models.CASCADE)
name = models.CharField(max_length=200)
docstring = models.TextField(blank=True, default="")
docstring = models.TextField(default="")
filename = models.CharField(max_length=511, default="")

objects = ModuleManager()
Expand Down Expand Up @@ -140,7 +140,7 @@ class Klass(models.Model):

module = models.ForeignKey(Module, models.CASCADE)
name = models.CharField(max_length=200)
docstring = models.TextField(blank=True, default="")
docstring = models.TextField(default="")
line_number = models.IntegerField()
import_path = models.CharField(max_length=255)
# because docs urls differ between Django versions
Expand Down Expand Up @@ -353,7 +353,7 @@ class Method(models.Model):

klass = models.ForeignKey(Klass, models.CASCADE)
name = models.CharField(max_length=200)
docstring = models.TextField(blank=True, default="")
docstring = models.TextField(default="")
code = models.TextField()
kwargs = models.CharField(max_length=200)
line_number = models.IntegerField()
Expand Down

0 comments on commit 8894a34

Please sign in to comment.