add filters and submitted field for tickets

feature/enhanced-ticket-view
Mallory Hancock 2019-01-19 10:46:20 -08:00
parent 31e0ef4add
commit 3879017dd1
5 changed files with 50 additions and 2 deletions

4
.gitignore vendored
View File

@ -7,3 +7,7 @@ __pycache__
.viminfo
ttadmin/settings_live.py
ttadmin/static
venv/
build/
dist/

View File

@ -3,5 +3,6 @@ from .models import Ticket
@admin.register(Ticket)
class TicketAdmin(admin.ModelAdmin):
list_display = ('issue_status', 'issue_type', 'name', 'email')
list_display = ('submitted', 'issue_status', 'issue_type', 'name', 'email')
list_filter = ('issue_status', 'issue_type')
fields = ('name', 'email', 'issue_status', 'issue_type', 'issue_text')

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2019-01-19 18:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('help', '0003_auto_20171110_2323'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='submitted',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
]

View File

@ -1,4 +1,4 @@
from django.db.models import Model, TextField, EmailField, CharField
from django.db.models import Model, TextField, EmailField, CharField, DateTimeField
ISSUE_TYPE_CHOICES = (
('logging_in', 'help logging in'),
@ -18,6 +18,7 @@ ISSUE_STATUS_CHOICES = (
class Ticket(Model):
submitted = DateTimeField(auto_now_add=True)
name = CharField(blank=False, null=False, max_length=100)
email = EmailField(blank=False, null=False)
issue_type = CharField(choices=ISSUE_TYPE_CHOICES,

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2019-01-19 18:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20170114_0757'),
]
operations = [
migrations.AlterField(
model_name='pubkey',
name='key_type',
field=models.CharField(choices=[('ssh-rsa', 'ssh-rsa'), ('ssh-dss', 'ssh-dss'), ('ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp256')], max_length=50),
),
]