Browse Source

model travel is now based on extern instead of intern, service id is displayed and a readonly field

master
alpcentaur 1 year ago
parent
commit
6d3888172f
4 changed files with 27 additions and 3 deletions
  1. BIN
      input/.models.py.swp
  2. +3
    -2
      input/admin.py
  3. +23
    -0
      input/migrations/0089_auto_20221209_1648.py
  4. +1
    -1
      input/models.py

BIN
input/.models.py.swp View File


+ 3
- 2
input/admin.py View File

@ -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):

+ 23
- 0
input/migrations/0089_auto_20221209_1648.py View File

@ -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<br>in den Wikimedia-Projekten registriert hast.', max_length=200, null=True, verbose_name='Benutzer_innenname'),
),
]

+ 1
- 1
input/models.py View File

@ -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:')

Loading…
Cancel
Save