Skip to content

Commit e3913d8

Browse files
author
stef
committed
[enh] initial commit - model 1st version
0 parents  commit e3913d8

23 files changed

+337
-0
lines changed

__init__.py

Whitespace-only changes.

bt/__init__.py

Whitespace-only changes.

bt/models.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
5+
class Attachment(models.Model):
6+
attachment = models.EmailField()
7+
8+
class Comment(models.Model):
9+
submitter = models.EmailField()
10+
comment = models.TextField()
11+
comments = models.ForeignKey(Comment)
12+
13+
class Violation(models.Model):
14+
COUNTRIES = (
15+
# TODO complete and sort
16+
('A', 'Austria'),
17+
('B', 'Belgium'),
18+
('CZ', 'Czech Republic'),
19+
('HU', 'Hungary'),
20+
('RO', 'Romania'),
21+
('SE', 'Sweden'),
22+
('PL', 'Poland'),
23+
('ES', 'Spain'),
24+
('PT', 'Portugal'),
25+
('I', 'Italy'),
26+
('DE', 'Germany'),
27+
('SK', 'Slovakia'),
28+
('FR', 'France'),
29+
)
30+
RESOURCES = (
31+
('1', 'port'),
32+
('2', 'protocol'),
33+
('3', 'service'),
34+
('4', 'site'),
35+
('5', 'user'),
36+
('6', 'ip'),
37+
)
38+
TYPES = (
39+
('1', 'Blocking'),
40+
('2', 'Throttling'),
41+
)
42+
MEDIA = (
43+
('1', 'Fixed'),
44+
('2', 'Mobile'),
45+
)
46+
country = models.CharField(max_length=2, choices=COUNTRIES)
47+
operator = models.CharField()
48+
contract = models.CharField()
49+
comments = models.ForeignKey(Comment)
50+
resource = models.CharField(max_length=1, choices=RESOURCES)
51+
type = models.CharField(max_length=1, choices=RESOURCES)
52+
media = models.CharField(max_length=1, choices=MEDIA)
53+
temporary = models.BooleanField()
54+
contractual = models.BooleanField()
55+
contract = models.TextField()
56+
loophole = models.BooleanField()

bt/templatetags/__init__.py

Whitespace-only changes.

bt/templatetags/nnmon.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from django.template import Library, Variable
2+
from django.conf import settings
3+
from django import template
4+
import random
5+
6+
register = Library()
7+
8+
@register.simple_tag
9+
def root_url():
10+
return settings.ROOT_URL
11+
12+
@register.simple_tag
13+
def media_url():
14+
return settings.MEDIA_URL
15+

bt/tests.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
This file demonstrates writing tests using the unittest module. These will pass
3+
when you run "manage.py test".
4+
5+
Replace this with more appropriate tests for your application.
6+
"""
7+
8+
from django.test import TestCase
9+
10+
11+
class SimpleTest(TestCase):
12+
def test_basic_addition(self):
13+
"""
14+
Tests that 1 + 1 always equals 2.
15+
"""
16+
self.assertEqual(1 + 1, 2)

bt/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Create your views here.

manage.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/python
2+
from django.core.management import execute_manager
3+
import imp
4+
try:
5+
imp.find_module('settings') # Assumed to be in the same directory.
6+
except ImportError:
7+
import sys
8+
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
9+
sys.exit(1)
10+
11+
import settings
12+
13+
if __name__ == "__main__":
14+
execute_manager(settings)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "base.html" %}
2+
{% load i18n %}
3+
4+
{% block title %}Registration{% endblock %}
5+
6+
{% block content %}
7+
8+
{% trans "Your account activation might work now. If not mail me." %}
9+
10+
{% endblock content %}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "base.html" %}
2+
{% load i18n %}
3+
4+
{% block title %}Registration{% endblock %}
5+
6+
{% block content %}
7+
8+
{% trans "Your account is now active." %}
9+
10+
{% endblock content %}

0 commit comments

Comments
 (0)