minecraft_manager/api/models.py

22 lines
1.1 KiB
Python

from django.db import models
from minecraft_manager.api.api import generate_password
class Token(models.Model):
key = models.CharField("Key", default=generate_password, max_length=50, unique=True)
description = models.CharField("Description", max_length=200, blank=True)
active = models.BooleanField("Active", default=True)
web_get_permission = models.BooleanField("Web GET", default=False)
web_post_permission = models.BooleanField("Web POST", default=False)
plugin_get_permission = models.BooleanField("Plugin GET", default=False)
plugin_post_permission = models.BooleanField("Plugin POST", default=False)
form_get_permission = models.BooleanField("Form GET", default=False)
form_post_permission = models.BooleanField("Form POST", default=False)
model_get_permission = models.BooleanField("Model GET", default=False)
model_post_permission = models.BooleanField("Model POST", default=False)
stats_get_permission = models.BooleanField("Stats GET", default=False)
stats_post_permission = models.BooleanField("Stats POST", default=False)
def __str__(self):
return self.key