aa-structures 2.8.0__py3-none-any.whl → 2.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/METADATA +2 -2
- {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/RECORD +62 -61
- structures/__init__.py +1 -1
- structures/admin.py +3 -3
- structures/app_settings.py +88 -69
- structures/core/notification_embeds/billing_embeds.py +40 -7
- structures/core/notification_embeds/{character_embeds.py → corporate_embeds.py} +23 -13
- structures/core/notification_embeds/main.py +76 -38
- structures/core/notification_embeds/moonmining_embeds.py +12 -17
- structures/core/notification_embeds/orbital_embeds.py +3 -8
- structures/core/notification_embeds/sov_embeds.py +21 -19
- structures/core/notification_embeds/structures_embeds.py +19 -26
- structures/core/notification_embeds/tower_embeds.py +2 -2
- structures/core/notification_embeds/war_embeds.py +298 -92
- structures/core/notification_types.py +63 -44
- structures/forms.py +0 -1
- structures/helpers.py +13 -0
- structures/locale/de/LC_MESSAGES/django.po +488 -302
- structures/locale/django.pot +494 -308
- structures/locale/en/LC_MESSAGES/django.po +494 -308
- structures/locale/es/LC_MESSAGES/django.po +488 -302
- structures/locale/fr_FR/LC_MESSAGES/django.po +494 -308
- structures/locale/it_IT/LC_MESSAGES/django.po +494 -308
- structures/locale/ja/LC_MESSAGES/django.po +494 -308
- structures/locale/ko_KR/LC_MESSAGES/django.po +488 -302
- structures/locale/ru/LC_MESSAGES/django.mo +0 -0
- structures/locale/ru/LC_MESSAGES/django.po +532 -349
- structures/locale/uk/LC_MESSAGES/django.po +488 -302
- structures/locale/zh_Hans/LC_MESSAGES/django.po +488 -302
- structures/migrations/0005_add_notification_types.py +135 -0
- structures/models/eveuniverse.py +0 -1
- structures/models/notifications.py +1 -1
- structures/models/owners.py +3 -1
- structures/tests/core/notification_embeds/test_main.py +29 -27
- structures/tests/core/test_notification_structuretimers.py +2 -1
- structures/tests/core/test_notifications_timerboard.py +2 -1
- structures/tests/core/test_serializers.py +4 -2
- structures/tests/core/test_starbases.py +4 -2
- structures/tests/integration/test_tasks.py +2 -1
- structures/tests/integration/test_views.py +6 -3
- structures/tests/models/test_eveuniverse.py +2 -1
- structures/tests/models/test_notifications_1.py +16 -21
- structures/tests/models/test_notifications_2.py +4 -2
- structures/tests/models/test_notifications_3.py +6 -3
- structures/tests/models/test_notifications_discord.py +2 -1
- structures/tests/models/test_owners_1.py +28 -4
- structures/tests/models/test_owners_2.py +2 -1
- structures/tests/models/test_owners_3.py +2 -1
- structures/tests/models/test_owners_4.py +2 -1
- structures/tests/models/test_owners_5.py +8 -4
- structures/tests/models/test_structures.py +16 -8
- structures/tests/test_helpers.py +23 -3
- structures/tests/test_managers_1.py +16 -8
- structures/tests/test_managers_2.py +2 -1
- structures/tests/test_tasks.py +12 -6
- structures/tests/testdata/entities.json +150 -0
- structures/tests/testdata/helpers.py +1 -0
- structures/tests/views/test_public.py +2 -1
- structures/tests/views/test_statistics.py +2 -1
- structures/tests/views/test_structures.py +20 -10
- {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/LICENSE +0 -0
- {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/WHEEL +0 -0
structures/helpers.py
CHANGED
@@ -7,6 +7,7 @@ from urllib.parse import urlparse
|
|
7
7
|
from django.utils.html import format_html, format_html_join
|
8
8
|
from django.utils.safestring import SafeText, mark_safe
|
9
9
|
from django.utils.timezone import now
|
10
|
+
from eveuniverse.models import EveEntity, EveType
|
10
11
|
|
11
12
|
|
12
13
|
def hours_until_deadline(
|
@@ -43,6 +44,18 @@ def get_or_create_esi_obj(model_class: type, *args, **kwargs) -> Any:
|
|
43
44
|
return obj
|
44
45
|
|
45
46
|
|
47
|
+
def get_or_create_eve_entity(*args, **kwargs) -> EveEntity:
|
48
|
+
"""Get or create an EveEntity object from ESI and return it."""
|
49
|
+
obj = get_or_create_esi_obj(EveEntity, *args, **kwargs)
|
50
|
+
return obj
|
51
|
+
|
52
|
+
|
53
|
+
def get_or_create_eve_type(*args, **kwargs) -> EveType:
|
54
|
+
"""Get or create an EveEntity object from ESI and return it."""
|
55
|
+
obj = get_or_create_esi_obj(EveType, *args, **kwargs)
|
56
|
+
return obj
|
57
|
+
|
58
|
+
|
46
59
|
def floating_icon_with_text_html(
|
47
60
|
icon_url: str, lines: List[Union[str, SafeText]]
|
48
61
|
) -> SafeText:
|