add index view; add Project and Issue models
This commit is contained in:
parent
6c43c8b360
commit
9d77a7d232
7 changed files with 78 additions and 6 deletions
|
|
@ -1,3 +1,21 @@
|
|||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Project(models.Model):
|
||||
project_key = models.CharField(max_length=16, unique=True)
|
||||
name = models.CharField(max_length=200)
|
||||
description = models.TextField(blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Issue(models.Model):
|
||||
project = models.ForeignKey(Project, on_delete=models.CASCADE)
|
||||
title = models.CharField(max_length=200)
|
||||
text = models.TextField(blank=True)
|
||||
create_date = models.DateTimeField(default=timezone.now)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
|
|
|||
Reference in a new issue