HI guys I´m trying to make a simple timesheet app, first time I´m 
programming. 
So I have this code where I set in models.py the Client and then I want to 
have the Project class sync with the Client class.
So for each Client I have a different set of Projects.
Now my problem is in Task class I set the variable project = Project 
(class) however this is the only field I can´t see on my django site.
What am I doing wrong?

class Client(models.Model):
    name = models.CharField(max_length=20)

    def __str__(self):
        return format(self.name)


class Project(models.Model):
    client = models.ForeignKey(Client, on_delete=models.CASCADE)
    project = models.CharField(max_length=20)

    def __str__(self):
        return format(self.project)


class Task(models.Model):
    client = models.ForeignKey(Client, on_delete=models.CASCADE)
    project = Project
    date = models.DateField()
    assignment = models.CharField(max_length=200)
    hours = models.DecimalField(max_digits=4, decimal_places=2)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5a30c747-c409-40aa-bd7a-392130563efe%40googlegroups.com.

Reply via email to