| 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}" | |