Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wikidata field for authors #3275

Merged
merged 4 commits into from
Mar 23, 2024
Merged

Conversation

ccamara
Copy link
Contributor

@ccamara ccamara commented Feb 3, 2024

This PR simply creates a field for wikidata and displays it on the author's profile. Nothing else.

Adding a wikidata field to author's profile would be the first step to address the issues with multiple, multilingual wikipedia links #1585

@ccamara ccamara marked this pull request as ready for review February 6, 2024 22:49
@ccamara
Copy link
Contributor Author

ccamara commented Feb 6, 2024

This PR simply creates a field for wikidata and displays it on the author's profile. Nothing else.

Currently, any string can be added to the field. I would want to add the following:

  • validation, i.e. to only accept Q followed by a number
  • automatic removal of https://wikidata.org
  • Some description/label explaining what is expected to be inputted/or how to get the wikidata's ID

But I do not know how to do it. Suggestions are welcome.

Also, I would like to create an importer, but this will come in future PR, if I manage to understand how the inventaire import works (I believe there will be quite some things to re-use).

Copy link
Member

@mouse-reeve mouse-reeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the only change needed her is removing the change to the model. Otherwise it's a great addition to have this be an editable field on Author.

@@ -18,6 +18,9 @@ class Author(BookDataModel):
wikipedia_link = fields.CharField(
max_length=255, blank=True, null=True, deduplication_field=True
)
wikidata = fields.CharField(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to add this here -- the field is already on this model, it's inherited from the parent model, BookDataModel: https://github.com/bookwyrm-social/bookwyrm/blob/main/bookwyrm/models/book.py#L55

@mouse-reeve mouse-reeve merged commit bac52ee into bookwyrm-social:main Mar 23, 2024
10 checks passed
@ccamara
Copy link
Contributor Author

ccamara commented Mar 26, 2024

thanks for dealing wiht this, @mouse-reeve . Apologies because life got busy for me and I left that unfinished. Glad you did it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants