change to foreign key definition in portfolio

This commit is contained in:
David Kennedy 2024-07-23 11:43:49 -04:00
parent 01a6257ef4
commit c17e4e4eaa
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 6 additions and 2 deletions

View file

@ -73,7 +73,7 @@ class Migration(migrations.Migration):
field=models.ForeignKey( field=models.ForeignKey(
help_text="Associated user", help_text="Associated user",
on_delete=django.db.models.deletion.PROTECT, on_delete=django.db.models.deletion.PROTECT,
related_name="creator", related_name="created_portfolios",
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
), ),
), ),

View file

@ -24,7 +24,11 @@ class Portfolio(TimeStampedModel):
# Stores who created this model. If no creator is specified in DJA, # Stores who created this model. If no creator is specified in DJA,
# then the creator will default to the current request user""" # then the creator will default to the current request user"""
creator = models.ForeignKey( creator = models.ForeignKey(
"registrar.User", on_delete=models.PROTECT, help_text="Associated user", related_name="creator", unique=False "registrar.User",
on_delete=models.PROTECT,
help_text="Associated user",
related_name="created_portfolios",
unique=False,
) )
notes = models.TextField( notes = models.TextField(