hackens-orga/hackens_orga/agent/models.py

14 lines
331 B
Python
Raw Normal View History

2023-02-08 02:04:34 +01:00
from django.contrib.auth.models import User
from django.db import models
class Agent(models.Model):
name = models.CharField(max_length=255)
user = models.OneToOneField(User, on_delete=models.CASCADE, null=True)
2023-02-16 19:10:23 +01:00
def __repr__(self):
2023-02-08 02:04:34 +01:00
return f"Agent_{self.name}"
2023-02-16 19:10:23 +01:00
def __str__(self):
return self.name