diff --git a/authserver/authserver/api/models.py b/authserver/authserver/api/models.py index 71a8362..3962a2b 100644 --- a/authserver/authserver/api/models.py +++ b/authserver/authserver/api/models.py @@ -1,3 +1,20 @@ from django.db import models -# Create your models here. +class Category(models.Model): + name = models.CharField(max_length=32) + slug = models.CharField(max_length=32) + info = models.TextField(max_length=1024, blank=True) + photo = models.FileField(upload_to='media/') + +class Tool(models.Model): + uuid = models.UUIDField(default=uuid.uuid4, editable=False) + category = models.ForeignKey(Category, related_name='tools') + name = models.CharField(max_length=32) + info = models.TextField(max_length=1024, blank=True) + wiki_id = models.IntegerField() + photo = models.FileField(upload_to='media/') + +class Profile(models.Model): + user = models.OneToOneField(User) + lockout_admin = models.BooleanField(default=False) + authorized_tools = models.ManyToManyField(Tool)