renamed Contributor`s FK to user more explicit

This commit is contained in:
yann 2025-05-25 21:26:11 +02:00
parent 80a2eb5b5d
commit 278ea3ed0a
3 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 5.2.1 on 2025-05-25 19:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('support', '0002_project_active_alter_issue_project'),
]
operations = [
migrations.RenameField(
model_name='contributor',
old_name='contributor',
new_name='user',
),
]

View File

@ -26,7 +26,7 @@ class Project(models.Model):
class Contributor(models.Model): class Contributor(models.Model):
contributor = models.ForeignKey(settings.AUTH_USER_MODEL, user = models.ForeignKey(settings.AUTH_USER_MODEL,
on_delete=models.DO_NOTHING) on_delete=models.DO_NOTHING)
project = models.ForeignKey('Project', project = models.ForeignKey('Project',
on_delete=models.CASCADE, on_delete=models.CASCADE,

View File

@ -9,3 +9,9 @@ class ProjectSerializer(ModelSerializer):
fields = ['title', 'date_created', 'type', 'description', 'author', fields = ['title', 'date_created', 'type', 'description', 'author',
'contributors'] 'contributors']
class ContributorSerialier(ModelSerializer):
class Meta:
model = Contributor
Fields = ['']