Hi to all!
Just begin my Python/Django experience and i have a problem :-)
So i have a model.py like this:
from django.db import models
class Priority(models.Model):
name = models.CharField(max_length=100)
class Projects(models.Model):
name = models.CharField(max_length=30)
description = models.CharField(max_length=150)
priority = models.ForeignKey(Priority)
class Tasks(models.Model):
name = models.CharField(max_length=30)
description = models.CharField(max_length=40)
priority = models.ForeignKey(Priority)
In the priority table i plan to store data like 1.High, 2.Medium , 3.Low and in Tasks table priority will be stored as id (1, 2 or 3)
And the question is how to write a view that display all my tasks but with Priority named? For example:
name: Task 1
description: Description 1
priority: **High**