Update connector and author tables

This commit is contained in:
Mouse Reeve 2020-03-28 13:03:49 -07:00
parent d94dbf3974
commit 54b5f0097b
3 changed files with 29 additions and 4 deletions

View file

@ -162,7 +162,7 @@ def get_date(date_string):
return datetime.strptime(date_string, date_format)
except ValueError:
pass
return False
return None
def get_description(description_blob):

View file

@ -0,0 +1,27 @@
# Generated by Django 3.0.3 on 2020-03-28 20:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0021_auto_20200328_0428'),
]
operations = [
migrations.RemoveField(
model_name='connector',
name='is_self',
),
migrations.AddField(
model_name='author',
name='fedireads_key',
field=models.CharField(max_length=255, null=True, unique=True),
),
migrations.AlterField(
model_name='connector',
name='connector_file',
field=models.CharField(choices=[('openlibrary', 'Openlibrary'), ('self_connector', 'Self Connector'), ('fedireads_connector', 'Fedireads Connector')], default='openlibrary', max_length=255),
),
]

View file

@ -20,9 +20,6 @@ class Connector(FedireadsModel):
default='openlibrary',
choices=ConnectorFiles.choices
)
# is this a connector to your own database, should only be true if
# the connector_file is `fedireads`
is_self = models.BooleanField(default=False)
api_key = models.CharField(max_length=255, null=True)
base_url = models.CharField(max_length=255)
@ -130,6 +127,7 @@ class Edition(Book):
class Author(FedireadsModel):
''' copy of an author from OL '''
openlibrary_key = models.CharField(max_length=255, null=True, unique=True)
fedireads_key = models.CharField(max_length=255, null=True, unique=True)
wikipedia_link = models.CharField(max_length=255, blank=True, null=True)
# idk probably other keys would be useful here?
born = models.DateTimeField(null=True)