from django.contrib import admin
-# Register your models here.
+from . import models
+
+class UserProfileAdmin(admin.ModelAdmin):
+ pass
+admin.site.register(models.UserProfile, UserProfileAdmin)
--- /dev/null
+# Generated by Django 4.0.3 on 2022-03-04 16:13
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('user_profile', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='userprofile',
+ name='user',
+ field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL),
+ ),
+ ]
from django.dispatch import receiver
class UserProfile(models.Model):
- user = models.OneToOneField(User, on_delete=models.CASCADE)
+ user = models.OneToOneField(
+ User,
+ on_delete=models.CASCADE,
+ related_name='profile',
+ )
notes = models.TextField(blank=True, null=True)
def __str__(self):