Add Last.fm importing

This commit is contained in:
2023-02-14 01:48:53 -05:00
parent 87f068dccd
commit 7a7c1caecc
10 changed files with 532 additions and 19 deletions

View File

@ -5,7 +5,10 @@ from django.db import models
from django_extensions.db.models import TimeStampedModel
from profiles.constants import PRETTY_TIMEZONE_CHOICES
from encrypted_field import EncryptedField
User = get_user_model()
BNULL = {"blank": True, "null": True}
class UserProfile(TimeStampedModel):
@ -15,6 +18,8 @@ class UserProfile(TimeStampedModel):
timezone = models.CharField(
max_length=255, choices=PRETTY_TIMEZONE_CHOICES
)
lastfm_username = models.CharField(max_length=255, **BNULL)
lastfm_password = EncryptedField(**BNULL)
def __str__(self):
return f"User profile for {self.user}"