Add schedule status column

This commit is contained in:
Joshua Rubingh 2020-05-18 16:53:40 +02:00
parent aa3342946f
commit 67320359fe
19 changed files with 278 additions and 146 deletions

Binary file not shown.

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-15 12:52+0200\n" "PO-Revision-Date: 2020-05-15 12:52+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,30 +26,30 @@ msgstr ""
msgid "Employees" msgid "Employees"
msgstr "" msgstr ""
#: apps/employee/models.py:13 #: apps/employee/models.py:28
msgid "employee" msgid "employee"
msgstr "" msgstr ""
#: apps/employee/models.py:14 #: apps/employee/models.py:29
msgid "employees" msgid "employees"
msgstr "" msgstr ""
#: apps/employee/models.py:16 #: apps/employee/models.py:31
msgid "Django user" msgid "Django user"
msgstr "" msgstr ""
#: apps/employee/models.py:18 #: apps/employee/models.py:33
msgid "Select the hospital for this employee" msgid "Select the hospital for this employee"
msgstr "" msgstr ""
#: apps/employee/models.py:20 #: apps/employee/models.py:35
msgid "Select the polyclinic(s) for this employee" msgid "Select the polyclinic(s) for this employee"
msgstr "" msgstr ""
#: apps/employee/models.py:21 #: apps/employee/models.py:36
msgid "Phone number" msgid "Phone number"
msgstr "" msgstr ""
#: apps/employee/models.py:21 #: apps/employee/models.py:36
msgid "The direct phone number of this employee" msgid "The direct phone number of this employee"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-15 12:46+0200\n" "PO-Revision-Date: 2020-05-15 12:46+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
@ -26,30 +26,30 @@ msgstr "Medewerker"
msgid "Employees" msgid "Employees"
msgstr "Medewerkers" msgstr "Medewerkers"
#: apps/employee/models.py:13 #: apps/employee/models.py:28
msgid "employee" msgid "employee"
msgstr "medewerker" msgstr "medewerker"
#: apps/employee/models.py:14 #: apps/employee/models.py:29
msgid "employees" msgid "employees"
msgstr "medewerkers" msgstr "medewerkers"
#: apps/employee/models.py:16 #: apps/employee/models.py:31
msgid "Django user" msgid "Django user"
msgstr "Django gebruiker" msgstr "Django gebruiker"
#: apps/employee/models.py:18 #: apps/employee/models.py:33
msgid "Select the hospital for this employee" msgid "Select the hospital for this employee"
msgstr "Selecteer het ziekenhuis voor deze medewerker" msgstr "Selecteer het ziekenhuis voor deze medewerker"
#: apps/employee/models.py:20 #: apps/employee/models.py:35
msgid "Select the polyclinic(s) for this employee" msgid "Select the polyclinic(s) for this employee"
msgstr "Selecteer de poliklinieken voor deze medewerker" msgstr "Selecteer de poliklinieken voor deze medewerker"
#: apps/employee/models.py:21 #: apps/employee/models.py:36
msgid "Phone number" msgid "Phone number"
msgstr "Telefoonummer" msgstr "Telefoonummer"
#: apps/employee/models.py:21 #: apps/employee/models.py:36
msgid "The direct phone number of this employee" msgid "The direct phone number of this employee"
msgstr "Het directe telefoonnummer van deze werknemer" msgstr "Het directe telefoonnummer van deze werknemer"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,50 +26,50 @@ msgstr ""
msgid "Hospitals" msgid "Hospitals"
msgstr "" msgstr ""
#: apps/hospital/models.py:10 #: apps/hospital/models.py:27
msgid "hospital" msgid "hospital"
msgstr "" msgstr ""
#: apps/hospital/models.py:11 #: apps/hospital/models.py:28
msgid "hospitals" msgid "hospitals"
msgstr "" msgstr ""
#: apps/hospital/models.py:13 #: apps/hospital/models.py:30
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: apps/hospital/models.py:13 #: apps/hospital/models.py:30
msgid "The name of this hospital" msgid "The name of this hospital"
msgstr "" msgstr ""
#: apps/hospital/models.py:14 #: apps/hospital/models.py:31
msgid "Address" msgid "Address"
msgstr "" msgstr ""
#: apps/hospital/models.py:14 #: apps/hospital/models.py:31
msgid "The address of this hospital" msgid "The address of this hospital"
msgstr "" msgstr ""
#: apps/hospital/models.py:15 #: apps/hospital/models.py:32
msgid "Postal code" msgid "Postal code"
msgstr "" msgstr ""
#: apps/hospital/models.py:15 #: apps/hospital/models.py:32
msgid "The postal code of this hospital" msgid "The postal code of this hospital"
msgstr "" msgstr ""
#: apps/hospital/models.py:16 #: apps/hospital/models.py:33
msgid "City" msgid "City"
msgstr "" msgstr ""
#: apps/hospital/models.py:16 #: apps/hospital/models.py:33
msgid "The city of this hospital" msgid "The city of this hospital"
msgstr "" msgstr ""
#: apps/hospital/models.py:17 #: apps/hospital/models.py:34
msgid "Phone number" msgid "Phone number"
msgstr "" msgstr ""
#: apps/hospital/models.py:17 #: apps/hospital/models.py:34
msgid "The general phone number of this hospital" msgid "The general phone number of this hospital"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-15 12:43+0200\n" "PO-Revision-Date: 2020-05-15 12:43+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
@ -26,50 +26,50 @@ msgstr "Ziekenhuis"
msgid "Hospitals" msgid "Hospitals"
msgstr "Ziekenhuizen" msgstr "Ziekenhuizen"
#: apps/hospital/models.py:10 #: apps/hospital/models.py:27
msgid "hospital" msgid "hospital"
msgstr "ziekenhuis" msgstr "ziekenhuis"
#: apps/hospital/models.py:11 #: apps/hospital/models.py:28
msgid "hospitals" msgid "hospitals"
msgstr "ziekenhuizen" msgstr "ziekenhuizen"
#: apps/hospital/models.py:13 #: apps/hospital/models.py:30
msgid "Name" msgid "Name"
msgstr "Naam" msgstr "Naam"
#: apps/hospital/models.py:13 #: apps/hospital/models.py:30
msgid "The name of this hospital" msgid "The name of this hospital"
msgstr "De naam van dit ziekenhuis" msgstr "De naam van dit ziekenhuis"
#: apps/hospital/models.py:14 #: apps/hospital/models.py:31
msgid "Address" msgid "Address"
msgstr "Adres" msgstr "Adres"
#: apps/hospital/models.py:14 #: apps/hospital/models.py:31
msgid "The address of this hospital" msgid "The address of this hospital"
msgstr "Het adres van dit ziekenhuis" msgstr "Het adres van dit ziekenhuis"
#: apps/hospital/models.py:15 #: apps/hospital/models.py:32
msgid "Postal code" msgid "Postal code"
msgstr "Postcode" msgstr "Postcode"
#: apps/hospital/models.py:15 #: apps/hospital/models.py:32
msgid "The postal code of this hospital" msgid "The postal code of this hospital"
msgstr "De postcode van dit ziekenhuis" msgstr "De postcode van dit ziekenhuis"
#: apps/hospital/models.py:16 #: apps/hospital/models.py:33
msgid "City" msgid "City"
msgstr "Stad" msgstr "Stad"
#: apps/hospital/models.py:16 #: apps/hospital/models.py:33
msgid "The city of this hospital" msgid "The city of this hospital"
msgstr "De stad waar dit ziekenhuis gelegen is" msgstr "De stad waar dit ziekenhuis gelegen is"
#: apps/hospital/models.py:17 #: apps/hospital/models.py:34
msgid "Phone number" msgid "Phone number"
msgstr "Telefoonnummer" msgstr "Telefoonnummer"
#: apps/hospital/models.py:17 #: apps/hospital/models.py:34
msgid "The general phone number of this hospital" msgid "The general phone number of this hospital"
msgstr "Het algemene telefoonummer van dit ziekenhuis" msgstr "Het algemene telefoonummer van dit ziekenhuis"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,30 +26,30 @@ msgstr ""
msgid "Polyclinics" msgid "Polyclinics"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:11 #: apps/polyclinic/models.py:24
msgid "polyclinic" msgid "polyclinic"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:12 #: apps/polyclinic/models.py:25
msgid "polyclinics" msgid "polyclinics"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:14 #: apps/polyclinic/models.py:27
msgid "To which hospital belongs this polyclinic" msgid "To which hospital belongs this polyclinic"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:15 #: apps/polyclinic/models.py:28
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:15 #: apps/polyclinic/models.py:28
msgid "The name of this polyclinic" msgid "The name of this polyclinic"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:16 #: apps/polyclinic/models.py:29
msgid "Phone number" msgid "Phone number"
msgstr "" msgstr ""
#: apps/polyclinic/models.py:16 #: apps/polyclinic/models.py:29
msgid "The general/direct phone number of this polyclinic" msgid "The general/direct phone number of this polyclinic"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-15 12:47+0200\n" "PO-Revision-Date: 2020-05-15 12:47+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
@ -26,30 +26,30 @@ msgstr "Polikliniek"
msgid "Polyclinics" msgid "Polyclinics"
msgstr "Poliklinieken" msgstr "Poliklinieken"
#: apps/polyclinic/models.py:11 #: apps/polyclinic/models.py:24
msgid "polyclinic" msgid "polyclinic"
msgstr "polikliniek" msgstr "polikliniek"
#: apps/polyclinic/models.py:12 #: apps/polyclinic/models.py:25
msgid "polyclinics" msgid "polyclinics"
msgstr "poliklinieken" msgstr "poliklinieken"
#: apps/polyclinic/models.py:14 #: apps/polyclinic/models.py:27
msgid "To which hospital belongs this polyclinic" msgid "To which hospital belongs this polyclinic"
msgstr "Bij welke ziekenhuis hoort deze polikliniek" msgstr "Bij welke ziekenhuis hoort deze polikliniek"
#: apps/polyclinic/models.py:15 #: apps/polyclinic/models.py:28
msgid "Name" msgid "Name"
msgstr "Naam" msgstr "Naam"
#: apps/polyclinic/models.py:15 #: apps/polyclinic/models.py:28
msgid "The name of this polyclinic" msgid "The name of this polyclinic"
msgstr "De naam van deze polikliniek" msgstr "De naam van deze polikliniek"
#: apps/polyclinic/models.py:16 #: apps/polyclinic/models.py:29
msgid "Phone number" msgid "Phone number"
msgstr "Telefoonnummer" msgstr "Telefoonnummer"
#: apps/polyclinic/models.py:16 #: apps/polyclinic/models.py:29
msgid "The general/direct phone number of this polyclinic" msgid "The general/direct phone number of this polyclinic"
msgstr "De algemene/directe telefoonnummer van deze polikliniek" msgstr "De algemene/directe telefoonnummer van deze polikliniek"

View File

@ -5,11 +5,12 @@ from .models import Schedule
# Register your models here. # Register your models here.
@admin.register(Schedule) @admin.register(Schedule)
class ScheduleAdmin(admin.ModelAdmin): class ScheduleAdmin(admin.ModelAdmin):
list_display = ('name', 'employee', 'email', 'created_at', 'processed') list_display = ('name', 'employee', 'email', 'created_at', 'status','done')
ordering = ('created_at', 'name',) ordering = ('-created_at', 'name',)
search_fields = ('name', 'email') search_fields = ('name', 'email')
list_filter = ('status',)
def processed(self,obj): def done(self,obj):
return len(obj.output_peregrine) > 0 return obj.done
processed.boolean = True done.boolean = True

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -42,89 +42,108 @@ msgstr ""
msgid "When the job is done, the results will be sent to this email address" msgid "When the job is done, the results will be sent to this email address"
msgstr "" msgstr ""
#: apps/schedule/models.py:14 #: apps/schedule/models.py:27
msgid "schedule" msgid "schedule"
msgstr "" msgstr ""
#: apps/schedule/models.py:15 #: apps/schedule/models.py:28
msgid "schedules" msgid "schedules"
msgstr "" msgstr ""
#: apps/schedule/models.py:18 #: apps/schedule/models.py:31
msgid "New"
msgstr ""
#: apps/schedule/models.py:32
msgid "Accepted"
msgstr ""
#: apps/schedule/models.py:33
msgid "Processing"
msgstr ""
#: apps/schedule/models.py:34
msgid "Processed"
msgstr ""
#: apps/schedule/models.py:35
msgid "Done"
msgstr ""
#: apps/schedule/models.py:36
msgid "Invalid"
msgstr ""
#: apps/schedule/models.py:37
msgid "Failure"
msgstr ""
#: apps/schedule/models.py:39
msgid "Select the employee that is responsible for this schedule request" msgid "Select the employee that is responsible for this schedule request"
msgstr "" msgstr ""
#: apps/schedule/models.py:20 #: apps/schedule/models.py:41
#: apps/schedule/templates/schedule/schedule_list.html:13 #: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: apps/schedule/models.py:20 #: apps/schedule/models.py:41
msgid "Name of the schedule" msgid "Name of the schedule"
msgstr "" msgstr ""
#: apps/schedule/models.py:21 #: apps/schedule/models.py:42
msgid "Email address" msgid "Email address"
msgstr "" msgstr ""
#: apps/schedule/models.py:21 #: apps/schedule/models.py:42
msgid "Email address where the results will be sent to." msgid "Email address where the results will be sent to."
msgstr "" msgstr ""
#: apps/schedule/models.py:23 #: apps/schedule/models.py:44
msgid "Status"
msgstr ""
#: apps/schedule/models.py:44
msgid "The status of this schedule."
msgstr ""
#: apps/schedule/models.py:46
msgid "Schedule input" msgid "Schedule input"
msgstr "" msgstr ""
#: apps/schedule/models.py:23 #: apps/schedule/models.py:46
msgid "The schedule input in JSON format based on the form data" msgid "The schedule input in JSON format based on the form data"
msgstr "" msgstr ""
#: apps/schedule/models.py:25 #: apps/schedule/models.py:51
msgid "Peregrine input"
msgstr ""
#: apps/schedule/models.py:25
msgid ""
"This is the translated content from the source for use with Peregrine cluster"
msgstr ""
#: apps/schedule/models.py:27
msgid "Peregrine accepted"
msgstr ""
#: apps/schedule/models.py:27
msgid "When true, the Peregrine cluster has picked up the job."
msgstr ""
#: apps/schedule/models.py:29
msgid "Peregrine JSON output" msgid "Peregrine JSON output"
msgstr "" msgstr ""
#: apps/schedule/models.py:29 #: apps/schedule/models.py:51
msgid "The results from the Peregrine job in JSON" msgid "The results from the Peregrine job in JSON"
msgstr "" msgstr ""
#: apps/schedule/models.py:31 #: apps/schedule/models.py:53
msgid "Peregrine binary output" msgid "Peregrine binary output"
msgstr "" msgstr ""
#: apps/schedule/models.py:31 #: apps/schedule/models.py:53
msgid "This is the output in binary format from the Peregrine cluster" msgid "This is the output in binary format from the Peregrine cluster"
msgstr "" msgstr ""
#: apps/schedule/models.py:33 #: apps/schedule/models.py:55
msgid "Report is send to user" msgid "Report is send to user"
msgstr "" msgstr ""
#: apps/schedule/models.py:33 #: apps/schedule/models.py:55
msgid "The date and time when the report has sended to the user." msgid "The date and time when the report has sended to the user."
msgstr "" msgstr ""
#: apps/schedule/models.py:35 #: apps/schedule/models.py:57
msgid "Peregrine logging" msgid "Peregrine logging"
msgstr "" msgstr ""
#: apps/schedule/models.py:35 #: apps/schedule/models.py:57
msgid "Here you can see the logging of the Peregrine job." msgid "Here you can see the logging of the Peregrine job."
msgstr "" msgstr ""

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-18 11:08+0200\n" "PO-Revision-Date: 2020-05-18 16:39+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
@ -42,88 +42,108 @@ msgstr "E-mailadres voor resultaten"
msgid "When the job is done, the results will be sent to this email address" msgid "When the job is done, the results will be sent to this email address"
msgstr "Als de klus geklaard is, worden de resultaten naar dit e-mailadres gestuurd" msgstr "Als de klus geklaard is, worden de resultaten naar dit e-mailadres gestuurd"
#: apps/schedule/models.py:14 #: apps/schedule/models.py:27
msgid "schedule" msgid "schedule"
msgstr "rooster" msgstr "rooster"
#: apps/schedule/models.py:15 #: apps/schedule/models.py:28
msgid "schedules" msgid "schedules"
msgstr "roosters" msgstr "roosters"
#: apps/schedule/models.py:18 #: apps/schedule/models.py:31
msgid "New"
msgstr "Nieuw"
#: apps/schedule/models.py:32
msgid "Accepted"
msgstr "Geaccepteerd"
#: apps/schedule/models.py:33
msgid "Processing"
msgstr "Verwerken"
#: apps/schedule/models.py:34
msgid "Processed"
msgstr "Verwerkt"
#: apps/schedule/models.py:35
msgid "Done"
msgstr "Klaar"
#: apps/schedule/models.py:36
msgid "Invalid"
msgstr "Ongeldig"
#: apps/schedule/models.py:37
msgid "Failure"
msgstr "Error"
#: apps/schedule/models.py:39
msgid "Select the employee that is responsible for this schedule request" msgid "Select the employee that is responsible for this schedule request"
msgstr "Selecteer de medewerker die verantwoordelijk is voor dit roosterverzoek" msgstr "Selecteer de medewerker die verantwoordelijk is voor dit roosterverzoek"
#: apps/schedule/models.py:20 #: apps/schedule/models.py:41
#: apps/schedule/templates/schedule/schedule_list.html:13 #: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name" msgid "Name"
msgstr "Naam" msgstr "Naam"
#: apps/schedule/models.py:20 #: apps/schedule/models.py:41
msgid "Name of the schedule" msgid "Name of the schedule"
msgstr "Naam van de rooster" msgstr "Naam van de rooster"
#: apps/schedule/models.py:21 #: apps/schedule/models.py:42
msgid "Email address" msgid "Email address"
msgstr "E-mailadres" msgstr "E-mailadres"
#: apps/schedule/models.py:21 #: apps/schedule/models.py:42
msgid "Email address where the results will be sent to." msgid "Email address where the results will be sent to."
msgstr "E-mailadres waar de resultaten naartoe worden gestuurd." msgstr "E-mailadres waar de resultaten naartoe worden gestuurd."
#: apps/schedule/models.py:23 #: apps/schedule/models.py:44
msgid "Status"
msgstr "Status"
#: apps/schedule/models.py:44
msgid "The status of this schedule."
msgstr "De status van dit rooster."
#: apps/schedule/models.py:46
msgid "Schedule input" msgid "Schedule input"
msgstr "Rooster invoer" msgstr "Rooster invoer"
#: apps/schedule/models.py:23 #: apps/schedule/models.py:46
msgid "The schedule input in JSON format based on the form data" msgid "The schedule input in JSON format based on the form data"
msgstr "De rooster invoer in JSON-indeling op basis van de formuliergegevens" msgstr "De rooster invoer in JSON-indeling op basis van de formuliergegevens"
#: apps/schedule/models.py:25 #: apps/schedule/models.py:51
msgid "Peregrine input"
msgstr "Peregrine invoer"
#: apps/schedule/models.py:25
msgid "This is the translated content from the source for use with Peregrine cluster"
msgstr "Dit is de vertaalde inhoud van de bron voor gebruik met Peregrine-cluster"
#: apps/schedule/models.py:27
msgid "Peregrine accepted"
msgstr "Peregrine geaccepteerd"
#: apps/schedule/models.py:27
msgid "When true, the Peregrine cluster has picked up the job."
msgstr "Als het waar is, heeft het Peregrine-cluster de taak opgepakt."
#: apps/schedule/models.py:29
msgid "Peregrine JSON output" msgid "Peregrine JSON output"
msgstr "Peregrine JSON uitvoer" msgstr "Peregrine JSON uitvoer"
#: apps/schedule/models.py:29 #: apps/schedule/models.py:51
msgid "The results from the Peregrine job in JSON" msgid "The results from the Peregrine job in JSON"
msgstr "De resultaten van de Peregrine-taak in JSON" msgstr "De resultaten van de Peregrine-taak in JSON"
#: apps/schedule/models.py:31 #: apps/schedule/models.py:53
msgid "Peregrine binary output" msgid "Peregrine binary output"
msgstr "Peregrine binaire uitvoer" msgstr "Peregrine binaire uitvoer"
#: apps/schedule/models.py:31 #: apps/schedule/models.py:53
msgid "This is the output in binary format from the Peregrine cluster" msgid "This is the output in binary format from the Peregrine cluster"
msgstr "Dit is de uitvoer in binair formaat van het Peregrine-cluster" msgstr "Dit is de uitvoer in binair formaat van het Peregrine-cluster"
#: apps/schedule/models.py:33 #: apps/schedule/models.py:55
msgid "Report is send to user" msgid "Report is send to user"
msgstr "Rapport is naar gebruiker gestuurd" msgstr "Rapport is naar gebruiker gestuurd"
#: apps/schedule/models.py:33 #: apps/schedule/models.py:55
msgid "The date and time when the report has sended to the user." msgid "The date and time when the report has sended to the user."
msgstr "De datum en tijd waarop het rapport naar de gebruiker is verzonden." msgstr "De datum en tijd waarop het rapport naar de gebruiker is verzonden."
#: apps/schedule/models.py:35 #: apps/schedule/models.py:57
msgid "Peregrine logging" msgid "Peregrine logging"
msgstr "Peregrine log" msgstr "Peregrine log"
#: apps/schedule/models.py:35 #: apps/schedule/models.py:57
msgid "Here you can see the logging of the Peregrine job." msgid "Here you can see the logging of the Peregrine job."
msgstr "Hier kunt u de logfile van de Peregrine opdracht zien." msgstr "Hier kunt u de logfile van de Peregrine opdracht zien."
@ -157,3 +177,15 @@ msgstr "Geen roosters beschikbaar"
#: apps/schedule/templates/schedule/schedule_new.html:6 #: apps/schedule/templates/schedule/schedule_new.html:6
msgid "New schedule" msgid "New schedule"
msgstr "Nieuwe rooster" msgstr "Nieuwe rooster"
#~ msgid "Peregrine input"
#~ msgstr "Peregrine invoer"
#~ msgid "This is the translated content from the source for use with Peregrine cluster"
#~ msgstr "Dit is de vertaalde inhoud van de bron voor gebruik met Peregrine-cluster"
#~ msgid "Peregrine accepted"
#~ msgstr "Peregrine geaccepteerd"
#~ msgid "When true, the Peregrine cluster has picked up the job."
#~ msgstr "Als het waar is, heeft het Peregrine-cluster de taak opgepakt."

View File

@ -0,0 +1,26 @@
# Generated by Django 3.0.6 on 2020-05-18 14:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schedule', '0003_auto_20200518_0902'),
]
operations = [
migrations.RemoveField(
model_name='schedule',
name='peregrine_accepted',
),
migrations.RemoveField(
model_name='schedule',
name='planning_peregrine',
),
migrations.AddField(
model_name='schedule',
name='status',
field=models.CharField(choices=[('new', 'New'), ('accepted', 'Accepted'), ('processing', 'Processing'), ('processed', 'Processed'), ('done', 'Done'), ('invalid', 'Invalid'), ('failure', 'Failure')], db_index=True, default='new', help_text='The status of this schedule.', max_length=10, verbose_name='Status'),
),
]

View File

@ -21,24 +21,63 @@ class Schedule(MetaDataModel):
The name of the schedule. Max length is 100 characters. The name of the schedule. Max length is 100 characters.
email : str email : str
The email address where the results should be sent to. Max length is 100 characters. The email address where the results should be sent to. Max length is 100 characters.
status : ScheduleStatus
The status of the schedule.
""" """
class Meta: class Meta:
verbose_name = _('schedule') verbose_name = _('schedule')
verbose_name_plural = _('schedules') verbose_name_plural = _('schedules')
class ScheduleStatus(models.TextChoices):
"""This is a sub class of Schedule which holds all the possible schedule statuses
.. data:: NEW
The schedule is just created and waiting to be picked up by the Peregrine scripts.
.. data:: ACCEPTED
The Peregrine scripts have accepted the new schedule job. And the input is valid.
.. data:: PROCESSING
The Peregrine job is submitted to the job queue and should be starting soon.
.. data:: PROCESSED
The Peregrine job is finished, and the results will be futher processed in order to create a new report with the outcome.
.. data:: DONE
The schedule rapport is created and uploaded to the database. The Peregrine process is done.
.. data:: INVALID
The entered data is invalid. Either directly by the posting of the form. Or when the Peregrine script could not read the input.
.. data:: FAILURE
Something when wrong on Peregrine. Look at the logging output of the Peregrine job
"""
NEW = 'new', _('New')
ACCEPTED = 'accepted', _('Accepted')
PROCESSING = 'processing', _('Processing')
PROCESSED = 'processed', _('Processed')
DONE = 'done', _('Done')
INVALID = 'invalid', _('Invalid')
FAILURE = 'failure', _('Failure')
employee = models.ForeignKey(Employee, on_delete=models.CASCADE, help_text=_('Select the employee that is responsible for this schedule request')) employee = models.ForeignKey(Employee, on_delete=models.CASCADE, help_text=_('Select the employee that is responsible for this schedule request'))
name = models.CharField(_('Name'), max_length=100, help_text=_('Name of the schedule')) name = models.CharField(_('Name'), max_length=100, help_text=_('Name of the schedule'))
email = models.CharField(_('Email address'), max_length=100, help_text=_('Email address where the results will be sent to.')) email = models.CharField(_('Email address'), max_length=100, help_text=_('Email address where the results will be sent to.'))
status = models.CharField(_('Status'), max_length=10, choices=ScheduleStatus.choices, default=ScheduleStatus.NEW, help_text=_('The status of this schedule.'), db_index=True, )
planning_source = JSONField(_('Schedule input'), blank=True, load_kwargs={'object_pairs_hook': collections.OrderedDict}, help_text=_('The schedule input in JSON format based on the form data')) planning_source = JSONField(_('Schedule input'), blank=True, load_kwargs={'object_pairs_hook': collections.OrderedDict}, help_text=_('The schedule input in JSON format based on the form data'))
planning_peregrine = models.TextField(_('Peregrine input'), blank=True, help_text=_('This is the translated content from the source for use with Peregrine cluster'))
peregrine_accepted = models.BooleanField(_('Peregrine accepted'),default=False, help_text=_('When true, the Peregrine cluster has picked up the job.'))
peregrine_result = JSONField(_('Peregrine JSON output'), blank=True, load_kwargs={'object_pairs_hook': collections.OrderedDict}, help_text=_('The results from the Peregrine job in JSON')) peregrine_result = JSONField(_('Peregrine JSON output'), blank=True, load_kwargs={'object_pairs_hook': collections.OrderedDict}, help_text=_('The results from the Peregrine job in JSON'))
output_peregrine = models.BinaryField(_('Peregrine binary output'), blank=True, help_text=_('This is the output in binary format from the Peregrine cluster')) output_peregrine = models.BinaryField(_('Peregrine binary output'), blank=True, help_text=_('This is the output in binary format from the Peregrine cluster'))
@ -47,6 +86,20 @@ class Schedule(MetaDataModel):
peregrine_output_log = models.TextField(_('Peregrine logging'), blank=True, help_text=_('Here you can see the logging of the Peregrine job.')) peregrine_output_log = models.TextField(_('Peregrine logging'), blank=True, help_text=_('Here you can see the logging of the Peregrine job.'))
@property
def done(self):
"""
Checks if the processing of this schedule is done on the Peregrine cluster. This can be either with the status:
1. :attr:`~ScheduleStatus.DONE`
2. :attr:`~ScheduleStatus.INVALID`
3. :attr:`~ScheduleStatus.FAILURE`
Returns:
boolean -- True when status is one of the above value.
"""
return self.status in [self.ScheduleStatus.DONE,self.ScheduleStatus.INVALID,self.ScheduleStatus.FAILURE]
def __str__(self): def __str__(self):
"""str: Returns a readable name for the schedule. Format is [schedule_name] (employee_name).""" """str: Returns a readable name for the schedule. Format is [schedule_name] (employee_name)."""
return '{} ({})'.format(self.name, self.employee) return '{} ({})'.format(self.name, self.employee)

View File

@ -32,6 +32,7 @@ def new_or_update_study(request, schedule = None):
new_schedule.planning_source = json.loads(schedule_form.cleaned_data['json']) new_schedule.planning_source = json.loads(schedule_form.cleaned_data['json'])
except json.JSONDecodeError as ex: except json.JSONDecodeError as ex:
new_schedule.planning_source = json.loads(json.dumps({'error': str(ex)})) new_schedule.planning_source = json.loads(json.dumps({'error': str(ex)}))
new_schedule.status = Schedule.ScheduleStatus.INVALID
new_schedule.employee = request.user.employee new_schedule.employee = request.user.employee
new_schedule.name = schedule_form.cleaned_data['name'] new_schedule.name = schedule_form.cleaned_data['name']

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-18 11:10+0200\n" "PO-Revision-Date: 2020-05-18 11:10+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
@ -62,9 +62,9 @@ msgid ""
"please go to the <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-" "please go to the <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-"
"meter-ziekenhuis/aanmelden\">Signup page</a> " "meter-ziekenhuis/aanmelden\">Signup page</a> "
msgstr "" msgstr ""
"Hier kunt u inloggen om nieuwe roosters te maken. Als u geen login heeft, " "Hier kunt u inloggen om nieuwe roosters te maken. Als u geen login heeft, ga "
"ga dan naar de <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-" "dan naar de <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-meter-"
"meter-ziekenhuis/aanmelden\">aanmeld page</a> " "ziekenhuis/aanmelden\">aanmeld page</a> "
#: templates/registration/login.html:24 #: templates/registration/login.html:24
msgid "Lost password?" msgid "Lost password?"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n" "POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-15 12:49+0200\n" "PO-Revision-Date: 2020-05-15 12:49+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"