From 6d3888172fe7112dabb4093a0007c6ba6b446e99 Mon Sep 17 00:00:00 2001 From: alpcentaur Date: Mon, 27 Feb 2023 17:09:29 +0000 Subject: [PATCH] model travel is now based on extern instead of intern, service id is displayed and a readonly field --- input/.models.py.swp | Bin 1024 -> 0 bytes input/admin.py | 5 +++-- input/migrations/0089_auto_20221209_1648.py | 23 ++++++++++++++++++++ input/models.py | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) delete mode 100644 input/.models.py.swp create mode 100644 input/migrations/0089_auto_20221209_1648.py diff --git a/input/.models.py.swp b/input/.models.py.swp deleted file mode 100644 index b7ad36d7725791f9570a22e76a5936683e1ae43c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{4DU_b#H0SpXjDM=_|xHxI~sYNM3lvt9Qmz0>7os*cGl#+<4IyXNh WHK$mwpb}GRRAe*+Mnhl#LI407F%c*L diff --git a/input/admin.py b/input/admin.py index 08df4ec..5537d38 100755 --- a/input/admin.py +++ b/input/admin.py @@ -90,12 +90,13 @@ class IFGAdmin(admin.ModelAdmin): @admin.register(Travel) class TravelAdmin(admin.ModelAdmin): save_as = True - search_fields = ['realname', 'granted_date'] - list_display = ('realname', 'granted', 'granted_date', 'project_end', 'project', 'project_end_quartal') + search_fields = ['realname', 'service_id', 'granted_date'] + list_display = ('realname', 'service_id', 'granted', 'granted_date', 'project_end', 'project', 'project_end_quartal') list_display_links = ('realname', 'project') date_hierarchy = 'project_end' readonly_fields = ('project_end_quartal', 'project_end') autocomplete_fields = ['project'] + readonly_fields = ['service_id'] @admin.register(Email) class EmailAdmin(admin.ModelAdmin): diff --git a/input/migrations/0089_auto_20221209_1648.py b/input/migrations/0089_auto_20221209_1648.py new file mode 100644 index 0000000..55f394d --- /dev/null +++ b/input/migrations/0089_auto_20221209_1648.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.2 on 2022-12-09 16:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0088_auto_20221208_2128'), + ] + + operations = [ + migrations.AddField( + model_name='travel', + name='service_id', + field=models.CharField(blank=True, max_length=15, null=True), + ), + migrations.AddField( + model_name='travel', + name='username', + field=models.CharField(help_text='Bitte gib den Namen ein, mit dem du dich
in den Wikimedia-Projekten registriert hast.', max_length=200, null=True, verbose_name='Benutzer_innenname'), + ), + ] diff --git a/input/models.py b/input/models.py index d1d00e0..d57d599 100755 --- a/input/models.py +++ b/input/models.py @@ -179,7 +179,7 @@ HOTEL_CHOICES = {'TRUE': format_html('Hotelzimmer benötigt'), from django.contrib.contenttypes.models import ContentType -class Travel(Volunteer): +class Travel(Extern): # project variable is now null true and blank true, which means it can be saved without project id to be later on filled out by admins project = models.ForeignKey(Project, on_delete=models.CASCADE, null=True, blank=True) project_name = models.CharField(max_length=50, null=True, blank=True, verbose_name='Projektname:')