25 lines
No EOL
971 B
Python
25 lines
No EOL
971 B
Python
import uuid
|
|
from django.db import models
|
|
from django.utils import timezone
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
# Create your models here.
|
|
class App(models.Model):
|
|
class AppTypeChoices(models.IntegerChoices):
|
|
INTERNAL = 0, _('internal')
|
|
EXTERNAL = 1, _('external')
|
|
|
|
uuid = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4, unique=True, db_index=True)
|
|
title = models.CharField(_('title'), max_length=30, blank=True)
|
|
description = models.TextField(_('description'), null=True, blank=True)
|
|
order = models.IntegerField(_("order"), blank=True, null=True)
|
|
logo = models.ImageField(upload_to='apps_logo', null=True, blank=True)
|
|
type = models.IntegerField(_("app type"), choices=AppTypeChoices.choices, blank=True, null=True)
|
|
url = models.CharField(_('url'), max_length=30, blank=True)
|
|
|
|
def get_uuid(self):
|
|
return str(self.uuid)
|
|
|
|
def __str__(self):
|
|
return self.title |