Implement PartialDateField using SealedDate and a custom descriptor
This commit is contained in:
parent
9752819bdb
commit
737ac8e908
7 changed files with 285 additions and 7 deletions
54
bookwyrm/migrations/0182_auto_20231023_0246.py
Normal file
54
bookwyrm/migrations/0182_auto_20231023_0246.py
Normal 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),
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue