sonar fixes

This commit is contained in:
jain
2023-07-10 12:10:15 +05:30
parent 3098de36b8
commit 026bfb6da7
14 changed files with 94 additions and 51 deletions

View File

@ -5,6 +5,7 @@ from django.contrib.auth import get_user_model
"""Import Django app"""
from base.constants import GENDERS, TASK_STATUS, PENDING, TASK_POINTS
from junior.models import Junior
"""Add user model"""
User = get_user_model()
# Create your models here.
@ -44,16 +45,22 @@ class Guardian(models.Model):
return f'{self.user}'
class JuniorTask(models.Model):
"""Guardian model"""
"""Junior Task details model"""
guardian = models.ForeignKey(Guardian, on_delete=models.CASCADE, related_name='guardian', verbose_name='Guardian')
"""task details"""
task_name = models.CharField(max_length=100)
task_description = models.CharField(max_length=500)
"""points of the task"""
points = models.IntegerField(default=TASK_POINTS)
due_date = models.DateField(auto_now_add=False, null=True, blank=True)
"""Images of task"""
default_image = models.URLField(null=True, blank=True, default=None)
image = models.URLField(null=True, blank=True, default=None)
"""associated junior with the task"""
junior = models.ForeignKey(Junior, on_delete=models.CASCADE, related_name='junior', verbose_name='Junior')
"""task status"""
task_status = models.CharField(choices=TASK_STATUS, max_length=15, default=PENDING)
"""task stage"""
is_active = models.BooleanField(default=True)
is_approved = models.BooleanField(default=False)
"""Profile created and updated time"""