blob: 02073e6faad1e995b010c10048917ee7c384ca2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from jenkins.models import JenkinsSlave
class Resource(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=100, unique=True)
description = models.CharField(max_length=300, blank=True, null=True)
url = models.CharField(max_length=100, blank=True, null=True)
owners = models.ManyToManyField(User)
slave = models.ForeignKey(JenkinsSlave, on_delete=models.DO_NOTHING)
class Meta:
db_table = 'resource'
def __str__(self):
return self.name
|