mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 04:51:11 +00:00
Fixes book uid helper function
This commit is contained in:
parent
73df951ac0
commit
c72bd98957
2 changed files with 9 additions and 8 deletions
|
@ -47,6 +47,13 @@ class Book(FedireadsModel):
|
|||
# TODO: why can't I just call this work????
|
||||
parent_work = models.ForeignKey('Work', on_delete=models.PROTECT, null=True)
|
||||
|
||||
@property
|
||||
def absolute_id(self):
|
||||
''' constructs the absolute reference to any db object '''
|
||||
base_path = 'https://%s' % DOMAIN
|
||||
model_name = type(self).__name__.lower()
|
||||
return '%s/%s/%s' % (base_path, model_name, self.openlibrary_key)
|
||||
|
||||
|
||||
class Work(Book):
|
||||
''' a work (an abstract concept of a book that manifests in an edition) '''
|
||||
|
@ -61,13 +68,6 @@ class Edition(Book):
|
|||
oclc_number = models.CharField(max_length=255, unique=True, null=True)
|
||||
pages = models.IntegerField(null=True)
|
||||
|
||||
@property
|
||||
def absolute_id(self):
|
||||
''' constructs the absolute reference to any db object '''
|
||||
base_path = 'https://%s' % DOMAIN
|
||||
model_name = type(self).__name__.lower()
|
||||
return '%s/%s/%s' % (base_path, model_name, self.openlibrary_key)
|
||||
|
||||
|
||||
class Author(FedireadsModel):
|
||||
''' copy of an author from OL '''
|
||||
|
|
|
@ -66,6 +66,7 @@ def get_remote_reviews(user):
|
|||
book_id,
|
||||
status['name'],
|
||||
status['content'],
|
||||
status['rating']
|
||||
status['rating'],
|
||||
status.get('published'),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue