21 lines
1.0 KiB
Python
21 lines
1.0 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)
|
|
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
|