hackens-orga/agent/models.py

14 lines
344 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)
2023-03-08 01:48:29 +01:00
user = models.OneToOneField(User, on_delete=models.SET_NULL, blank=True, null=True)
2023-02-08 02:04:34 +01:00
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