mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
* Initial testing of paplink functionality. More fancy interfaces coming. * Removed a invalid view reference. * Added a link on the front page. * Fixed some bad references and incorrect in game browser header usages. * Started work on statistics-pages. * Added an initial modify-paplink page where the pap itself can be deleted and characters removed. * Added a very simple statistics page. Also some name change for ~reasons~. * Small but crucial fix of syntax. * Added personal statistics page. * Corputils page now include fatlinkstats. * Added link to the personal statistics page. Moved other buttons for clarity. * Removed some unused code and imports * Added more statistics, and all corps in alliance are now visible even if no paps are registered. * Now requesting trust for the right domain. And some redundant imports and commented lines are removed.
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
from optimer.models import optimer
|
|
from eveonline.models import EveCharacter
|
|
from datetime import datetime
|
|
from datetime import date
|
|
from django.utils import timezone
|
|
|
|
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):
|
|
output = "Fat-link for %s" % self.character.character_name
|
|
return output.encode('utf-8')
|