mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-13 10:36:25 +01:00
Restructure Alliance Auth package (#867)
* Refactor allianceauth into its own package * Add setup * Add missing default_app_config declarations * Fix timerboard namespacing * Remove obsolete future imports * Remove py2 mock support * Remove six * Add experimental 3.7 support and multiple Dj versions * Remove python_2_unicode_compatible * Add navhelper as local package * Update requirements
This commit is contained in:
36
allianceauth/fleetactivitytracking/models.py
Normal file
36
allianceauth/fleetactivitytracking/models.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
from allianceauth.eveonline.models import EveCharacter
|
||||
|
||||
|
||||
def get_sentinel_user():
|
||||
return User.objects.get_or_create(username='deleted')[0]
|
||||
|
||||
|
||||
class Fatlink(models.Model):
|
||||
fatdatetime = models.DateTimeField(default=timezone.now)
|
||||
duration = models.PositiveIntegerField()
|
||||
fleet = models.CharField(max_length=254, default="")
|
||||
name = models.CharField(max_length=254)
|
||||
hash = models.CharField(max_length=254, unique=True)
|
||||
creator = models.ForeignKey(User, on_delete=models.SET(get_sentinel_user))
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Fat(models.Model):
|
||||
character = models.ForeignKey(EveCharacter, on_delete=models.CASCADE)
|
||||
fatlink = models.ForeignKey(Fatlink)
|
||||
system = models.CharField(max_length=30)
|
||||
shiptype = models.CharField(max_length=30)
|
||||
station = models.CharField(max_length=125)
|
||||
user = models.ForeignKey(User)
|
||||
|
||||
class Meta:
|
||||
unique_together = (('character', 'fatlink'),)
|
||||
|
||||
def __str__(self):
|
||||
return "Fat-link for %s" % self.character.character_name
|
||||
Reference in New Issue
Block a user