mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Update connector and author tables
This commit is contained in:
parent
d94dbf3974
commit
54b5f0097b
3 changed files with 29 additions and 4 deletions
|
@ -162,7 +162,7 @@ def get_date(date_string):
|
||||||
return datetime.strptime(date_string, date_format)
|
return datetime.strptime(date_string, date_format)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
return False
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_description(description_blob):
|
def get_description(description_blob):
|
||||||
|
|
27
fedireads/migrations/0022_auto_20200328_2001.py
Normal file
27
fedireads/migrations/0022_auto_20200328_2001.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -20,9 +20,6 @@ class Connector(FedireadsModel):
|
||||||
default='openlibrary',
|
default='openlibrary',
|
||||||
choices=ConnectorFiles.choices
|
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)
|
api_key = models.CharField(max_length=255, null=True)
|
||||||
|
|
||||||
base_url = models.CharField(max_length=255)
|
base_url = models.CharField(max_length=255)
|
||||||
|
@ -130,6 +127,7 @@ class Edition(Book):
|
||||||
class Author(FedireadsModel):
|
class Author(FedireadsModel):
|
||||||
''' copy of an author from OL '''
|
''' copy of an author from OL '''
|
||||||
openlibrary_key = models.CharField(max_length=255, null=True, unique=True)
|
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)
|
wikipedia_link = models.CharField(max_length=255, blank=True, null=True)
|
||||||
# idk probably other keys would be useful here?
|
# idk probably other keys would be useful here?
|
||||||
born = models.DateTimeField(null=True)
|
born = models.DateTimeField(null=True)
|
||||||
|
|
Loading…
Reference in a new issue