File size: 603 Bytes
9e798a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from tortoise import fields, models


class Portal(models.Model):
    id = fields.IntField(pk=True)
    name = fields.CharField(
        max_length=50,
        unique=True,
        description="Name of the portal, e.g., Android or MikroTik",
    )
    description = fields.CharField(
        max_length=255,
        description="Description of the portal",
    )
    url = fields.CharField(
        max_length=255,
        description="URL of the portal, must start with http or https",
    )

    class Meta:
        table = "portals"

    def __str__(self):
        return f"{self.name} - {self.url}"