1
0
Fork 0

Implement PartialDateField using SealedDate and a custom descriptor

This commit is contained in:
Adeodato Simó 2023-10-23 00:10:01 -03:00
parent 9752819bdb
commit 737ac8e908
No known key found for this signature in database
GPG key ID: CDF447845F1A986F
7 changed files with 285 additions and 7 deletions

View file

@ -0,0 +1,54 @@
# Generated by Django 3.2.20 on 2023-10-23 02:46
import bookwyrm.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0181_merge_20230806_2302"),
]
operations = [
migrations.AddField(
model_name="book",
name="first_published_date_precision",
field=models.CharField(
blank=True,
choices=[
("DAY", "Day seal"),
("MONTH", "Month seal"),
("YEAR", "Year seal"),
],
editable=False,
max_length=10,
null=True,
),
),
migrations.AddField(
model_name="book",
name="published_date_precision",
field=models.CharField(
blank=True,
choices=[
("DAY", "Day seal"),
("MONTH", "Month seal"),
("YEAR", "Year seal"),
],
editable=False,
max_length=10,
null=True,
),
),
migrations.AlterField(
model_name="book",
name="first_published_date",
field=bookwyrm.models.fields.PartialDateField(blank=True, null=True),
),
migrations.AlterField(
model_name="book",
name="published_date",
field=bookwyrm.models.fields.PartialDateField(blank=True, null=True),
),
]