1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Add logs and block for templates

This commit is contained in:
Retspen 2015-03-03 11:34:09 +02:00
parent 55e93a9087
commit 5960e94da5
35 changed files with 183 additions and 29 deletions

0
logs/__init__.py Normal file
View file

3
logs/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View file

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('instances', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Logs',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('message', models.CharField(max_length=255)),
('date', models.DateTimeField()),
('instance', models.ForeignKey(to='instances.Instance')),
],
options={
},
bases=(models.Model,),
),
]

View file

11
logs/models.py Normal file
View file

@ -0,0 +1,11 @@
from django.db import models
from instances.models import Instance
class Logs(models.Model):
instance = models.ForeignKey(Instance)
message = models.CharField(max_length=255)
date = models.DateTimeField()
def __unicode__(self):
return self.instance

3
logs/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

8
logs/views.py Normal file
View file

@ -0,0 +1,8 @@
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from logs.models import Logs
def showlogs(request):
return render(request, 'showlogs.html', locals())