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 ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \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"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,30 +26,30 @@ msgstr ""
msgid "Employees"
msgstr ""
#: apps/employee/models.py:13
#: apps/employee/models.py:28
msgid "employee"
msgstr ""
#: apps/employee/models.py:14
#: apps/employee/models.py:29
msgid "employees"
msgstr ""
#: apps/employee/models.py:16
#: apps/employee/models.py:31
msgid "Django user"
msgstr ""
#: apps/employee/models.py:18
#: apps/employee/models.py:33
msgid "Select the hospital for this employee"
msgstr ""
#: apps/employee/models.py:20
#: apps/employee/models.py:35
msgid "Select the polyclinic(s) for this employee"
msgstr ""
#: apps/employee/models.py:21
#: apps/employee/models.py:36
msgid "Phone number"
msgstr ""
#: apps/employee/models.py:21
#: apps/employee/models.py:36
msgid "The direct phone number of this employee"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \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"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -26,30 +26,30 @@ msgstr "Medewerker"
msgid "Employees"
msgstr "Medewerkers"
#: apps/employee/models.py:13
#: apps/employee/models.py:28
msgid "employee"
msgstr "medewerker"
#: apps/employee/models.py:14
#: apps/employee/models.py:29
msgid "employees"
msgstr "medewerkers"
#: apps/employee/models.py:16
#: apps/employee/models.py:31
msgid "Django user"
msgstr "Django gebruiker"
#: apps/employee/models.py:18
#: apps/employee/models.py:33
msgid "Select the hospital for this employee"
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"
msgstr "Selecteer de poliklinieken voor deze medewerker"
#: apps/employee/models.py:21
#: apps/employee/models.py:36
msgid "Phone number"
msgstr "Telefoonummer"
#: apps/employee/models.py:21
#: apps/employee/models.py:36
msgid "The direct phone number of this employee"
msgstr "Het directe telefoonnummer van deze werknemer"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,50 +26,50 @@ msgstr ""
msgid "Hospitals"
msgstr ""
#: apps/hospital/models.py:10
#: apps/hospital/models.py:27
msgid "hospital"
msgstr ""
#: apps/hospital/models.py:11
#: apps/hospital/models.py:28
msgid "hospitals"
msgstr ""
#: apps/hospital/models.py:13
#: apps/hospital/models.py:30
msgid "Name"
msgstr ""
#: apps/hospital/models.py:13
#: apps/hospital/models.py:30
msgid "The name of this hospital"
msgstr ""
#: apps/hospital/models.py:14
#: apps/hospital/models.py:31
msgid "Address"
msgstr ""
#: apps/hospital/models.py:14
#: apps/hospital/models.py:31
msgid "The address of this hospital"
msgstr ""
#: apps/hospital/models.py:15
#: apps/hospital/models.py:32
msgid "Postal code"
msgstr ""
#: apps/hospital/models.py:15
#: apps/hospital/models.py:32
msgid "The postal code of this hospital"
msgstr ""
#: apps/hospital/models.py:16
#: apps/hospital/models.py:33
msgid "City"
msgstr ""
#: apps/hospital/models.py:16
#: apps/hospital/models.py:33
msgid "The city of this hospital"
msgstr ""
#: apps/hospital/models.py:17
#: apps/hospital/models.py:34
msgid "Phone number"
msgstr ""
#: apps/hospital/models.py:17
#: apps/hospital/models.py:34
msgid "The general phone number of this hospital"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \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"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -26,50 +26,50 @@ msgstr "Ziekenhuis"
msgid "Hospitals"
msgstr "Ziekenhuizen"
#: apps/hospital/models.py:10
#: apps/hospital/models.py:27
msgid "hospital"
msgstr "ziekenhuis"
#: apps/hospital/models.py:11
#: apps/hospital/models.py:28
msgid "hospitals"
msgstr "ziekenhuizen"
#: apps/hospital/models.py:13
#: apps/hospital/models.py:30
msgid "Name"
msgstr "Naam"
#: apps/hospital/models.py:13
#: apps/hospital/models.py:30
msgid "The name of this hospital"
msgstr "De naam van dit ziekenhuis"
#: apps/hospital/models.py:14
#: apps/hospital/models.py:31
msgid "Address"
msgstr "Adres"
#: apps/hospital/models.py:14
#: apps/hospital/models.py:31
msgid "The address of this hospital"
msgstr "Het adres van dit ziekenhuis"
#: apps/hospital/models.py:15
#: apps/hospital/models.py:32
msgid "Postal code"
msgstr "Postcode"
#: apps/hospital/models.py:15
#: apps/hospital/models.py:32
msgid "The postal code of this hospital"
msgstr "De postcode van dit ziekenhuis"
#: apps/hospital/models.py:16
#: apps/hospital/models.py:33
msgid "City"
msgstr "Stad"
#: apps/hospital/models.py:16
#: apps/hospital/models.py:33
msgid "The city of this hospital"
msgstr "De stad waar dit ziekenhuis gelegen is"
#: apps/hospital/models.py:17
#: apps/hospital/models.py:34
msgid "Phone number"
msgstr "Telefoonnummer"
#: apps/hospital/models.py:17
#: apps/hospital/models.py:34
msgid "The general phone number of this hospital"
msgstr "Het algemene telefoonummer van dit ziekenhuis"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,30 +26,30 @@ msgstr ""
msgid "Polyclinics"
msgstr ""
#: apps/polyclinic/models.py:11
#: apps/polyclinic/models.py:24
msgid "polyclinic"
msgstr ""
#: apps/polyclinic/models.py:12
#: apps/polyclinic/models.py:25
msgid "polyclinics"
msgstr ""
#: apps/polyclinic/models.py:14
#: apps/polyclinic/models.py:27
msgid "To which hospital belongs this polyclinic"
msgstr ""
#: apps/polyclinic/models.py:15
#: apps/polyclinic/models.py:28
msgid "Name"
msgstr ""
#: apps/polyclinic/models.py:15
#: apps/polyclinic/models.py:28
msgid "The name of this polyclinic"
msgstr ""
#: apps/polyclinic/models.py:16
#: apps/polyclinic/models.py:29
msgid "Phone number"
msgstr ""
#: apps/polyclinic/models.py:16
#: apps/polyclinic/models.py:29
msgid "The general/direct phone number of this polyclinic"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \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"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -26,30 +26,30 @@ msgstr "Polikliniek"
msgid "Polyclinics"
msgstr "Poliklinieken"
#: apps/polyclinic/models.py:11
#: apps/polyclinic/models.py:24
msgid "polyclinic"
msgstr "polikliniek"
#: apps/polyclinic/models.py:12
#: apps/polyclinic/models.py:25
msgid "polyclinics"
msgstr "poliklinieken"
#: apps/polyclinic/models.py:14
#: apps/polyclinic/models.py:27
msgid "To which hospital belongs this polyclinic"
msgstr "Bij welke ziekenhuis hoort deze polikliniek"
#: apps/polyclinic/models.py:15
#: apps/polyclinic/models.py:28
msgid "Name"
msgstr "Naam"
#: apps/polyclinic/models.py:15
#: apps/polyclinic/models.py:28
msgid "The name of this polyclinic"
msgstr "De naam van deze polikliniek"
#: apps/polyclinic/models.py:16
#: apps/polyclinic/models.py:29
msgid "Phone number"
msgstr "Telefoonnummer"
#: apps/polyclinic/models.py:16
#: apps/polyclinic/models.py:29
msgid "The general/direct phone number of this polyclinic"
msgstr "De algemene/directe telefoonnummer van deze polikliniek"

View File

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

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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"
msgstr ""
#: apps/schedule/models.py:14
#: apps/schedule/models.py:27
msgid "schedule"
msgstr ""
#: apps/schedule/models.py:15
#: apps/schedule/models.py:28
msgid "schedules"
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"
msgstr ""
#: apps/schedule/models.py:20
#: apps/schedule/models.py:41
#: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name"
msgstr ""
#: apps/schedule/models.py:20
#: apps/schedule/models.py:41
msgid "Name of the schedule"
msgstr ""
#: apps/schedule/models.py:21
#: apps/schedule/models.py:42
msgid "Email address"
msgstr ""
#: apps/schedule/models.py:21
#: apps/schedule/models.py:42
msgid "Email address where the results will be sent to."
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"
msgstr ""
#: apps/schedule/models.py:23
#: apps/schedule/models.py:46
msgid "The schedule input in JSON format based on the form data"
msgstr ""
#: apps/schedule/models.py:25
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
#: apps/schedule/models.py:51
msgid "Peregrine JSON output"
msgstr ""
#: apps/schedule/models.py:29
#: apps/schedule/models.py:51
msgid "The results from the Peregrine job in JSON"
msgstr ""
#: apps/schedule/models.py:31
#: apps/schedule/models.py:53
msgid "Peregrine binary output"
msgstr ""
#: apps/schedule/models.py:31
#: apps/schedule/models.py:53
msgid "This is the output in binary format from the Peregrine cluster"
msgstr ""
#: apps/schedule/models.py:33
#: apps/schedule/models.py:55
msgid "Report is send to user"
msgstr ""
#: apps/schedule/models.py:33
#: apps/schedule/models.py:55
msgid "The date and time when the report has sended to the user."
msgstr ""
#: apps/schedule/models.py:35
#: apps/schedule/models.py:57
msgid "Peregrine logging"
msgstr ""
#: apps/schedule/models.py:35
#: apps/schedule/models.py:57
msgid "Here you can see the logging of the Peregrine job."
msgstr ""

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-18 09:07+0000\n"
"PO-Revision-Date: 2020-05-18 11:08+0200\n"
"POT-Creation-Date: 2020-05-18 14:38+0000\n"
"PO-Revision-Date: 2020-05-18 16:39+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \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"
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"
msgstr "rooster"
#: apps/schedule/models.py:15
#: apps/schedule/models.py:28
msgid "schedules"
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"
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
msgid "Name"
msgstr "Naam"
#: apps/schedule/models.py:20
#: apps/schedule/models.py:41
msgid "Name of the schedule"
msgstr "Naam van de rooster"
#: apps/schedule/models.py:21
#: apps/schedule/models.py:42
msgid "Email address"
msgstr "E-mailadres"
#: apps/schedule/models.py:21
#: apps/schedule/models.py:42
msgid "Email address where the results will be sent to."
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"
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"
msgstr "De rooster invoer in JSON-indeling op basis van de formuliergegevens"
#: apps/schedule/models.py:25
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
#: apps/schedule/models.py:51
msgid "Peregrine JSON output"
msgstr "Peregrine JSON uitvoer"
#: apps/schedule/models.py:29
#: apps/schedule/models.py:51
msgid "The results from the Peregrine job 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"
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"
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"
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."
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"
msgstr "Peregrine log"
#: apps/schedule/models.py:35
#: apps/schedule/models.py:57
msgid "Here you can see the logging of the Peregrine job."
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
msgid "New schedule"
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.
email : str
The email address where the results should be sent to. Max length is 100 characters.
status : ScheduleStatus
The status of the schedule.
"""
class Meta:
verbose_name = _('schedule')
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'))
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.'))
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_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'))
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.'))
@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):
"""str: Returns a readable name for the schedule. Format is [schedule_name] (employee_name)."""
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'])
except json.JSONDecodeError as 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.name = schedule_form.cleaned_data['name']

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \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"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
@ -62,9 +62,9 @@ msgid ""
"please go to the <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-"
"meter-ziekenhuis/aanmelden\">Signup page</a> "
msgstr ""
"Hier kunt u inloggen om nieuwe roosters te maken. Als u geen login heeft, "
"ga dan naar de <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-"
"meter-ziekenhuis/aanmelden\">aanmeld page</a> "
"Hier kunt u inloggen om nieuwe roosters te maken. Als u geen login heeft, ga "
"dan naar de <a href=\"https://www.rug.nl/cope/projecten/het-anderhalve-meter-"
"ziekenhuis/aanmelden\">aanmeld page</a> "
#: templates/registration/login.html:24
msgid "Lost password?"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \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"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"