From 5d436f9294a5dc16b05683fe44778037d0347f2d Mon Sep 17 00:00:00 2001 From: corsaronero Date: Thu, 17 Nov 2022 18:19:18 +0000 Subject: [PATCH] added intern_notes variable to all dbs, not excluded in extern view for all --- input/forms.py | 10 ++++- ...ntern_notes_email_intern_notes_and_more.py | 43 +++++++++++++++++++ input/migrations/0073_account_intern_notes.py | 18 ++++++++ input/migrations/0074_project_intern_notes.py | 18 ++++++++ input/models.py | 13 ++++-- 5 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 input/migrations/0072_businesscard_intern_notes_email_intern_notes_and_more.py create mode 100644 input/migrations/0073_account_intern_notes.py create mode 100644 input/migrations/0074_project_intern_notes.py diff --git a/input/forms.py b/input/forms.py index 3a7bae9..c3e8127 100644 --- a/input/forms.py +++ b/input/forms.py @@ -58,7 +58,7 @@ class TravelForm(FdbForm): # TODO: add some javascript to show/hide other-field class Meta: model = Travel - exclude = ('granted', 'granted_date', 'survey_mail_send', 'realname', 'email', 'survey_mail_date', 'project', 'request_url', 'payed_for_hotel_by', 'payed_for_travel_by' ) + exclude = ('granted', 'granted_date', 'survey_mail_send', 'realname', 'email', 'survey_mail_date', 'project', 'request_url', 'payed_for_hotel_by', 'payed_for_travel_by', 'intern_notes' ) widgets = {'checkin': AdminDateWidget(), 'checkout': AdminDateWidget(),} @@ -67,16 +67,19 @@ class LibraryForm(FdbForm): class Meta: model = Library fields = ['cost', 'library', 'duration', 'notes'] + exclude = ['intern_notes'] class HonoraryCertificateForm(FdbForm): class Meta: model = HonoraryCertificate fields = ['request_url', 'project'] + exclude = ['intern_notes'] class IFGForm(FdbForm): class Meta: model = IFG fields = ['cost', 'url', 'notes'] + exclude = ['intern_notes'] class CheckForm(FdbForm): @@ -93,6 +96,7 @@ class LiteratureForm(CheckForm): class Meta: model = Literature fields = ['cost', 'info', 'source', 'notes', 'selfbuy', 'selfbuy_give_data'] + exclude = ['intern_notes'] class Media: js = ('dropdown/js/base.js',) @@ -108,6 +112,7 @@ class EmailForm(CheckForm): class Meta: model = Email fields = ['domain', 'address', 'other', 'adult'] + exclude = ['intern_notes'] class Media: js = ('dropdown/js/base.js',) @@ -121,7 +126,7 @@ class BusinessCardForm(CheckForm): class Meta: model = BusinessCard - + exclude = ['intern_notes'] fields = ['project', 'data', 'variant', 'url_of_pic', 'sent_to'] class Media: js = ('dropdown/js/base.js',) @@ -131,4 +136,5 @@ class ListForm(CheckForm): class Meta: model = List fields = ['domain', 'address'] + exclude = ['intern_notes'] diff --git a/input/migrations/0072_businesscard_intern_notes_email_intern_notes_and_more.py b/input/migrations/0072_businesscard_intern_notes_email_intern_notes_and_more.py new file mode 100644 index 0000000..d837869 --- /dev/null +++ b/input/migrations/0072_businesscard_intern_notes_email_intern_notes_and_more.py @@ -0,0 +1,43 @@ +# Generated by Django 4.1.2 on 2022-11-17 18:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0071_honorarycertificate_intern_notes_travel_intern_notes'), + ] + + operations = [ + migrations.AddField( + model_name='businesscard', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + migrations.AddField( + model_name='email', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + migrations.AddField( + model_name='ifg', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + migrations.AddField( + model_name='library', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + migrations.AddField( + model_name='list', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + migrations.AddField( + model_name='literature', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + ] diff --git a/input/migrations/0073_account_intern_notes.py b/input/migrations/0073_account_intern_notes.py new file mode 100644 index 0000000..1048bc7 --- /dev/null +++ b/input/migrations/0073_account_intern_notes.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.2 on 2022-11-17 18:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0072_businesscard_intern_notes_email_intern_notes_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='account', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + ] diff --git a/input/migrations/0074_project_intern_notes.py b/input/migrations/0074_project_intern_notes.py new file mode 100644 index 0000000..ef6dce2 --- /dev/null +++ b/input/migrations/0074_project_intern_notes.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.2 on 2022-11-17 18:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0073_account_intern_notes'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='intern_notes', + field=models.TextField(blank=True, max_length=1000), + ), + ] diff --git a/input/models.py b/input/models.py index 703c43d..e42cd43 100644 --- a/input/models.py +++ b/input/models.py @@ -55,7 +55,7 @@ class Account(models.Model): code = models.CharField('Kostenstelle', max_length=5, default="DEF", null=False, primary_key = True) description = models.CharField('Beschreibung', max_length=60, default='NO DESCRIPTION') - + intern_notes = models.TextField(max_length=1000, blank=True) def __str__(self): return f"{self.code} {self.description}" @@ -79,7 +79,8 @@ class Project(Volunteer): account = models.ForeignKey('Account', on_delete=models.CASCADE, null=True, to_field='code', db_constraint = False) granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von') notes = models.TextField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen') - + intern_notes = models.TextField(max_length=1000, blank=True) + # the following Fields are not supposed to be edited by users pid = models.CharField(max_length=15, null=True, blank=True) end_mail_send = models.BooleanField(null=True) @@ -190,7 +191,7 @@ class Library(Grant): ) library = models.CharField(max_length=200) duration = models.CharField(max_length=100, verbose_name="Dauer") - + intern_notes = models.TextField(max_length=1000, blank=True) def __str__(self): return self.library @@ -209,11 +210,12 @@ class Literature(Grant): help_text="Bitte gib an, wo du das Werk kaufen möchtest.") selfbuy = models.CharField( max_length=10, verbose_name='Selbstkauf?', choices=SELFBUY_CHOICES.items(), default='TRUE') selfbuy_give_data = models.BooleanField(default='NONE', verbose_name=format_html('Datenweitergabe erlauben'), help_text=format_html('Weitergabe meiner Daten (Name, Postadresse) an den von mir angegebenen Anbieter/Dienstleister.')) + intern_notes = models.TextField(max_length=1000, blank=True) class IFG(Grant): url = models.URLField(max_length=2000, verbose_name="URL", help_text="Bitte gib den Link zu deiner Anfrage bei Frag den Staat an.") - + intern_notes = models.TextField(max_length=1000, blank=True) def __str__(self): return "IFG-Anfrage von " + self.realname @@ -249,11 +251,13 @@ class Email(Domain): other = models.CharField(max_length=50,blank=True,null=True, verbose_name="Sonstiges") adult = models.CharField( max_length=10, verbose_name='Volljährigkeit', choices=ADULT_CHOICES.items(), default='NONE') + intern_notes = models.TextField(max_length=1000, blank=True) class List(Domain): address = models.CharField(max_length=50, default='NO_ADDRESS', verbose_name="Adressbestandteil für Projektmailingliste", help_text=format_html("Bitte gib hier den gewünschten Adressbestandteil an,
der sich vor der Domain befinden soll.")) + intern_notes = models.TextField(max_length=1000, blank=True) PROJECT_CHOICE = {'PEDIA': 'Wikipedia', 'SOURCE': 'Wikisource', @@ -291,3 +295,4 @@ class BusinessCard(Extern): sent_to = models.TextField(max_length=1000, verbose_name='Versandadresse', default='', help_text="Bitte gib den Namen und die vollständige Adresse ein, an welche die Visitenkarten geschickt werden sollen.") send_data_to_print = models.BooleanField(default=False, verbose_name=format_html('Datenweitergabe erlauben'), help_text=format_html('Hiermit erlaube ich die Weitergabe meiner Daten (Name, Postadresse) an den von Wikimedia Deutschland ausgewählten Dienstleister (z. B. wir-machen-druck.de) zum Zwecke des direkten Versands der Druckerzeugnisse an mich.')) + intern_notes = models.TextField(max_length=1000, blank=True)