Første release med alle filer
This commit is contained in:
parent
24cf2e284f
commit
3f25063003
BIN
UpdateSSIS/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
UpdateSSIS/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
UpdateSSIS/__pycache__/settings.cpython-37.pyc
Normal file
BIN
UpdateSSIS/__pycache__/settings.cpython-37.pyc
Normal file
Binary file not shown.
BIN
UpdateSSIS/__pycache__/urls.cpython-37.pyc
Normal file
BIN
UpdateSSIS/__pycache__/urls.cpython-37.pyc
Normal file
Binary file not shown.
BIN
UpdateSSIS/__pycache__/wsgi.cpython-37.pyc
Normal file
BIN
UpdateSSIS/__pycache__/wsgi.cpython-37.pyc
Normal file
Binary file not shown.
@ -37,6 +37,10 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'updateIt.apps.UpdateitConfig',
|
||||
'django_tables2',
|
||||
'django_filters',
|
||||
'bootstrap3',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@ -75,9 +79,15 @@ WSGI_APPLICATION = 'UpdateSSIS.wsgi.application'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
'ENGINE': 'sql_server.pyodbc',
|
||||
'NAME': 'UDV_DENKER',
|
||||
'HOST': 'bi-dsa-udv\dsa',
|
||||
'PORT': '',
|
||||
|
||||
'OPTIONS': {
|
||||
'driver': 'ODBC Driver 13 for SQL Server',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -14,8 +14,11 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path,include
|
||||
from updateIt.views import FilteredssispackagesListView
|
||||
from updateIt.filters import ssispackagesFilter
|
||||
|
||||
urlpatterns = [
|
||||
path('updateIt/',include('updateIt.urls'), name='updateIt'),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
||||
0
db.sqlite3
Normal file
0
db.sqlite3
Normal file
0
updateIt/__init__.py
Normal file
0
updateIt/__init__.py
Normal file
BIN
updateIt/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/admin.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/admin.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/apps.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/apps.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/filters.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/filters.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/models.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/models.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/tables.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/tables.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/urls.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/urls.cpython-37.pyc
Normal file
Binary file not shown.
BIN
updateIt/__pycache__/views.cpython-37.pyc
Normal file
BIN
updateIt/__pycache__/views.cpython-37.pyc
Normal file
Binary file not shown.
3
updateIt/admin.py
Normal file
3
updateIt/admin.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
5
updateIt/apps.py
Normal file
5
updateIt/apps.py
Normal file
@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class UpdateitConfig(AppConfig):
|
||||
name = 'updateIt'
|
||||
8
updateIt/filters.py
Normal file
8
updateIt/filters.py
Normal file
@ -0,0 +1,8 @@
|
||||
import django_filters
|
||||
from .models import ssispackages
|
||||
|
||||
class ssispackagesFilter(django_filters.FilterSet):
|
||||
|
||||
class Meta:
|
||||
model = ssispackages
|
||||
fields = ["SSISProject", "PackageName", "PackageNameProperty", "tfspath"]
|
||||
28
updateIt/migrations/0001_initial.py
Normal file
28
updateIt/migrations/0001_initial.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by Django 3.1.7 on 2021-03-01 21:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ssispackages',
|
||||
fields=[
|
||||
('tfspath', models.CharField(max_length=4000, primary_key=True, serialize=False)),
|
||||
('PackageName', models.CharField(max_length=500)),
|
||||
('PackageNameProperty', models.CharField(max_length=500)),
|
||||
('mtts', models.DateTimeField()),
|
||||
('SSISProject', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'ssispackages',
|
||||
'managed': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
0
updateIt/migrations/__init__.py
Normal file
0
updateIt/migrations/__init__.py
Normal file
BIN
updateIt/migrations/__pycache__/0001_initial.cpython-37.pyc
Normal file
BIN
updateIt/migrations/__pycache__/0001_initial.cpython-37.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
updateIt/migrations/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
updateIt/migrations/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
18
updateIt/models.py
Normal file
18
updateIt/models.py
Normal file
@ -0,0 +1,18 @@
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
|
||||
|
||||
class ssispackages(models.Model):
|
||||
id=models.IntegerField(primary_key=True),
|
||||
tfspath=models.CharField(max_length=4000)
|
||||
PackageName=models.CharField(max_length=500)
|
||||
PackageNameProperty=models.CharField(max_length=500)
|
||||
mtts=models.DateTimeField(null=False)
|
||||
SSISProject=models.CharField(max_length=200)
|
||||
ITPUpdate=models.BooleanField()
|
||||
ITUUpdate=models.BooleanField()
|
||||
def get_absolute_url(self):
|
||||
return reverse('updateIt:detail', args=[self.pk])
|
||||
class Meta:
|
||||
db_table = "ssispackages"
|
||||
# Create your models here.
|
||||
4
updateIt/requirements.txt
Normal file
4
updateIt/requirements.txt
Normal file
@ -0,0 +1,4 @@
|
||||
pip install django-mssql-backend
|
||||
pip install django-bootstrap
|
||||
pip install django-filter
|
||||
pip install django-tables2
|
||||
12
updateIt/tables.py
Normal file
12
updateIt/tables.py
Normal file
@ -0,0 +1,12 @@
|
||||
import django_tables2 as tables
|
||||
from .models import ssispackages
|
||||
from django.urls import reverse
|
||||
|
||||
class ssispackagesTable(tables.Table):
|
||||
SSISProject = tables.Column(linkify=True)
|
||||
class Meta:
|
||||
model = ssispackages
|
||||
template_name="django_tables2/bootstrap.html"
|
||||
fields = ("SSISProject", "PackageName", "PackageNameProperty", "tfspath", "ITPUpdate", "ITUUpdate")
|
||||
row_attrs={"data-id": lambda record:record.pk}
|
||||
attrs={"class": "deepblue"}
|
||||
39
updateIt/templates/updateIt/detail.html
Normal file
39
updateIt/templates/updateIt/detail.html
Normal file
@ -0,0 +1,39 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Liste af SSISProjekter</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1> {{ ssispackage.SSISProject }}</h1>
|
||||
<form action=" {% url 'updateIt:detail' ssispackage.id %} " method="get">
|
||||
{% csrf_token %}
|
||||
<table class="table table-bordered table-sm" style="width: 400px">
|
||||
<thead class="thead-dark">
|
||||
<th scope="col">PackageName></th><th scope="col">PackageNameProperty</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr scope="row">
|
||||
<td>{{ ssispackage.PackageName }}</td>
|
||||
<td>{{ ssispackage.PackageNameProperty }}</td>
|
||||
</tr>
|
||||
<tr scope="row">
|
||||
<td colspan=2>TFSPath<br>
|
||||
{{ ssispackage.tfspath }}</td>
|
||||
</tr>
|
||||
<tr scope="row">
|
||||
<td colspan=2><input type="checkbox" name="ITPUpdate" id="ITPUpdate" value="True" {% if ssispackage.ITPUpdate == True %}checked{% endif %}>
|
||||
<label for="ITPUpdate">IT-Platform opdaterer</label>
|
||||
<br><input type="checkbox" id="ITUUpdate" name="ITUUpdate" value="True" {% if ssispackage.ITUUpdate == True %}checked{% endif %}>
|
||||
<label for="ITUUpdate">Udvikler opdaterer selv</label><br>
|
||||
<input type="hidden" id="update" name="update" value="updated">
|
||||
<input type="submit" value="Opdater"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="../">Tilbage</a>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
19
updateIt/templates/updateIt/index.html
Normal file
19
updateIt/templates/updateIt/index.html
Normal file
@ -0,0 +1,19 @@
|
||||
{# tutorial/templates/tutorial/people.html #}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load bootstrap3 %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Liste af SSISProjekter</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
{% if filter %}
|
||||
<form action="" method="get" class="form form-inline">
|
||||
{% bootstrap_form filter.form layout='inline' %}
|
||||
{% bootstrap_button 'filter' %}
|
||||
</form>
|
||||
{% endif %}
|
||||
{% render_table table 'django_tables2/bootstrap.html' %}
|
||||
</body>
|
||||
</html>
|
||||
3
updateIt/tests.py
Normal file
3
updateIt/tests.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
8
updateIt/urls.py
Normal file
8
updateIt/urls.py
Normal file
@ -0,0 +1,8 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
app_name='updateIt'
|
||||
urlpatterns = [
|
||||
path('',views.FilteredssispackagesListView.as_view(),name="index"),
|
||||
path('<int:ssispackages_id>/',views.detail,name='detail'),
|
||||
]
|
||||
50
updateIt/views.py
Normal file
50
updateIt/views.py
Normal file
@ -0,0 +1,50 @@
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from django.http import HttpResponse
|
||||
from .models import ssispackages
|
||||
from django.template import loader
|
||||
from django.views.generic import ListView
|
||||
from .tables import ssispackagesTable
|
||||
from django_tables2 import SingleTableView
|
||||
from django_filters.views import FilterView
|
||||
from .filters import ssispackagesFilter
|
||||
from django.http import request
|
||||
import logging,sys
|
||||
|
||||
class FilteredssispackagesListView(SingleTableView,FilterView):
|
||||
model = ssispackages
|
||||
table_class = ssispackagesTable
|
||||
filterset_class = ssispackagesFilter
|
||||
template_name = 'updateIt/index.html'
|
||||
|
||||
def detail(request, ssispackages_id):
|
||||
ssispackage= get_object_or_404(ssispackages, pk=ssispackages_id)
|
||||
# logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
||||
updated="False"
|
||||
try:
|
||||
updated=request.GET['update']
|
||||
except:
|
||||
updated="False"
|
||||
try:
|
||||
a = request.GET['ITPUpdate']
|
||||
except:
|
||||
a=False
|
||||
try:
|
||||
b = request.GET['ITUUpdate']
|
||||
except:
|
||||
b=False
|
||||
if updated=="updated" and ssispackage.ITPUpdate!=a:
|
||||
ssispackage.ITPUpdate=bool(a)
|
||||
if updated=="updated" and ssispackage.ITUUpdate!=b:
|
||||
ssispackage.ITUUpdate=bool(b)
|
||||
if updated=="updated":
|
||||
ssispackage.save()
|
||||
|
||||
return render(request, 'updateIt/detail.html', {'ssispackage': ssispackage})
|
||||
|
||||
# def index(request):
|
||||
# list_ssispackages = ssispackages.objects.order_by('-PackageName')
|
||||
# context = {
|
||||
# 'list_ssispackages': list_ssispackages
|
||||
# }
|
||||
# return render(request,'updateIt/index.html', context)
|
||||
# Create your views here.
|
||||
Loading…
x
Reference in New Issue
Block a user