models.py 1.79 KB
Newer Older
1
2
from django.db import models

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
COUNTRIES = (
    ('BE', 'Belgium'),
    ('BG', 'Bulgaria'),
    ('CZ', 'Czech Republic'),
    ('DK', 'Denmark'),
    ('DE', 'Germany'),
    ('EE', 'Estonia'),
    ('IE', 'Ireland'),
    ('EL', 'Greece'),
    ('ES', 'Spain'),
    ('FR', 'France'),
    ('IT', 'Italy'),
    ('CY', 'Cyprus'),
    ('LV', 'Latvia'),
    ('LT', 'Lithuania'),
    ('LU', 'Luxembourg'),
    ('HU', 'Hungary'),
    ('MT', 'Malta'),
    ('NL', 'Netherlands'),
    ('AT', 'Austria'),
    ('PL', 'Poland'),
    ('PT', 'Portugal'),
    ('RO', 'Romania'),
    ('SI', 'Slovenia'),
    ('SK', 'Slovakia'),
    ('FI', 'Finland'),
    ('SE', 'Sweden'),
    ('UK', 'United Kingdom '),
    )
32
33

class Attachment(models.Model):
stef's avatar
stef committed
34
    attachment = models.FileField(upload_to='static')
35
36
37
38

class Comment(models.Model):
    submitter = models.EmailField()
    comment = models.TextField()
stef's avatar
stef committed
39
40
    date = models.DateField()
    attachments = models.ForeignKey(Attachment)
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

class Violation(models.Model):
    RESOURCES = (
        ('1', 'port'),
        ('2', 'protocol'),
        ('3', 'service'),
        ('4', 'site'),
        ('5', 'user'),
        ('6', 'ip'),
    )
    TYPES = (
        ('1', 'Blocking'),
        ('2', 'Throttling'),
    )
    MEDIA = (
        ('1', 'Fixed'),
        ('2', 'Mobile'),
    )
59
60
61
62
63
64
65
66
67
68
69
    country = models.CharField(max_length=2, choices=COUNTRIES)
    operator = models.CharField(max_length=256)
    contract = models.CharField(max_length=256)
    comments = models.ForeignKey(Comment)
    resource = models.CharField(max_length=1, choices=RESOURCES)
    type = models.CharField(max_length=1, choices=TYPES)
    media = models.CharField( max_length=1, choices=MEDIA)
    temporary = models.BooleanField( )
    contractual = models.BooleanField()
    contract_excerpt = models.TextField()
    loophole = models.BooleanField()