Skip to content

Commit

Permalink
feat(commands): add management command to update all bibtex fields
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Aug 21, 2024
1 parent 09049fe commit 0a04b4c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis_bibsonomy/management/commands/updatebibtex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.core.management.base import BaseCommand
from apis_bibsonomy.models import Reference
from apis_bibsonomy.utils import get_bibtex_from_url


class Command(BaseCommand):
help = "Update bibtex fields for all references"

def handle(self, *args, **options):
for obj in Reference.objects.all():
obj.bibtex = get_bibtex_from_url(obj.bibs_url)
obj.save()

0 comments on commit 0a04b4c

Please sign in to comment.