mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-28 19:10:35 +00:00
Formatting
This commit is contained in:
parent
dd15e87073
commit
2a612f7278
4 changed files with 36 additions and 10 deletions
|
@ -76,7 +76,16 @@ class ReviewForm(CustomForm):
|
|||
class CommentForm(CustomForm):
|
||||
class Meta:
|
||||
model = models.Comment
|
||||
fields = ["user", "book", "content", "content_warning", "sensitive", "privacy", "progress", "mode"]
|
||||
fields = [
|
||||
"user",
|
||||
"book",
|
||||
"content",
|
||||
"content_warning",
|
||||
"sensitive",
|
||||
"privacy",
|
||||
"progress",
|
||||
"mode",
|
||||
]
|
||||
|
||||
|
||||
class QuotationForm(CustomForm):
|
||||
|
|
|
@ -7,18 +7,28 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bookwyrm', '0054_auto_20210319_1942'),
|
||||
("bookwyrm", "0054_auto_20210319_1942"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='comment',
|
||||
name='mode',
|
||||
field=models.CharField(blank=True, choices=[('PG', 'page'), ('PCT', 'percent')], default='PG', max_length=3, null=True),
|
||||
model_name="comment",
|
||||
name="mode",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("PG", "page"), ("PCT", "percent")],
|
||||
default="PG",
|
||||
max_length=3,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='comment',
|
||||
name='progress',
|
||||
field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)]),
|
||||
model_name="comment",
|
||||
name="progress",
|
||||
field=models.IntegerField(
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[django.core.validators.MinValueValidator(0)],
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -8,6 +8,7 @@ from .base_model import BookWyrmModel
|
|||
|
||||
class ProgressMode(models.TextChoices):
|
||||
""" types of prgress available """
|
||||
|
||||
PAGE = "PG", "page"
|
||||
PERCENT = "PCT", "percent"
|
||||
|
||||
|
|
|
@ -232,9 +232,15 @@ class Comment(Status):
|
|||
|
||||
# this is it's own field instead of a foreign key to the progress update
|
||||
# so that the update can be deleted without impacting the status
|
||||
progress = models.IntegerField(validators=[MinValueValidator(0)], null=True, blank=True)
|
||||
progress = models.IntegerField(
|
||||
validators=[MinValueValidator(0)], null=True, blank=True
|
||||
)
|
||||
mode = models.CharField(
|
||||
max_length=3, choices=ProgressMode.choices, default=ProgressMode.PAGE, null=True, blank=True
|
||||
max_length=3,
|
||||
choices=ProgressMode.choices,
|
||||
default=ProgressMode.PAGE,
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue