Commit 2e968461 authored by Hubert Denkmair's avatar Hubert Denkmair
Browse files

add ApiKey model

parent f3281fa3
from django.contrib import admin
from core.models import SnakeVersion, SnakeGame, ServerCommand, UserProfile
from core.models import SnakeVersion, SnakeGame, ServerCommand, UserProfile, ApiKey
admin.site.register(SnakeVersion)
admin.site.register(SnakeGame)
admin.site.register(UserProfile)
admin.site.register(ApiKey)
class ServerCommandAdmin(admin.ModelAdmin):
......
# Generated by Django 2.0.4 on 2018-05-03 22:38
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0023_auto_20180502_1723'),
]
operations = [
migrations.CreateModel(
name='ApiKey',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('key', models.CharField(max_length=100)),
('comment', models.CharField(max_length=255)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
......@@ -86,3 +86,9 @@ class ServerCommand(models.Model):
command = models.CharField(max_length=255, choices=COMMAND_CHOICES)
result = models.NullBooleanField(editable=False)
result_msg = models.TextField(blank=True, null=True, editable=False)
class ApiKey(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
key = models.CharField(max_length=100)
comment = models.CharField(max_length=255)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment