mirror of
https://github.com/kristoferssolo/FOSSDB.git
synced 2025-10-21 17:50:35 +00:00
Created License model
This commit is contained in:
parent
082fd1c21b
commit
341ce260b9
@ -2,10 +2,21 @@ from django.contrib.auth.models import User
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
|
class License(models.Model):
|
||||||
|
short_name = models.CharField(max_length=50)
|
||||||
|
full_name = models.CharField(max_length=100, null=True, blank=True)
|
||||||
|
url = models.URLField(null=True, blank=True)
|
||||||
|
description = models.TextField(null=True, blank=True)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.short_name
|
||||||
|
|
||||||
|
|
||||||
class Project(models.Model):
|
class Project(models.Model):
|
||||||
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
|
license = models.ManyToManyField(License)
|
||||||
create_date = models.DateTimeField(auto_now_add=True)
|
create_date = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user