From 5ab338c3737cef32f0bc4783ccb84a9bc75fe076 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Mon, 20 Feb 2023 17:47:31 +0000 Subject: [PATCH] Fix line length issue and better spacing on exported PDF --- .../commands/generateSampleTrainingData.py | 14 +++++++++----- training/templates/item_list.xml | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/training/management/commands/generateSampleTrainingData.py b/training/management/commands/generateSampleTrainingData.py index d89cd724..f342c023 100644 --- a/training/management/commands/generateSampleTrainingData.py +++ b/training/management/commands/generateSampleTrainingData.py @@ -143,10 +143,14 @@ class Command(BaseCommand): "Bin Diving", "Wiki Editing"] - descriptions = ["Physical training concentrates on mechanistic goals: training programs in this area develop specific motor skills, agility, strength or physical fitness, often with an intention of peaking at a particular time.", - "In military use, training means gaining the physical ability to perform and survive in combat, and learn the many skills needed in a time of war. These include how to use a variety of weapons, outdoor survival skills, and how to survive being captured by the enemy, among many others. See military education and training.", - "For psychological or physiological reasons, people who believe it may be beneficial to them can choose to practice relaxation training, or autogenic training, in an attempt to increase their ability to relax or deal with stress. While some studies have indicated relaxation training is useful for some medical conditions, autogenic training has limited results or has been the result of few studies.", - "Some occupations are inherently hazardous, and require a minimum level of competence before the practitioners can perform the work at an acceptable level of safety to themselves or others in the vicinity. Occupational diving, rescue, firefighting and operation of certain types of machinery and vehicles may require assessment and certification of a minimum acceptable competence before the person is allowed to practice as a licensed instructor."] + descriptions = [ + "Physical training concentrates on mechanistic goals: training programs in this area develop specific motor skills, agility, strength or physical fitness, often with an intention of peaking at a particular time.", + "In military use, training means gaining the physical ability to perform and survive in combat, and learn the many skills needed in a time of war.", + "These include how to use a variety of weapons, outdoor survival skills, and how to survive being captured by the enemy, among many others. See military education and training.", + "While some studies have indicated relaxation training is useful for some medical conditions, autogenic training has limited results or has been the result of few studies.", + "Some occupations are inherently hazardous, and require a minimum level of competence before the practitioners can perform the work at an acceptable level of safety to themselves or others in the vicinity.", + "Occupational diving, rescue, firefighting and operation of certain types of machinery and vehicles may require assessment and certification of a minimum acceptable competence before the person is allowed to practice as a licensed instructor." + ] for i, name in enumerate(names): category = random.choice(self.categories) @@ -155,7 +159,7 @@ class Command(BaseCommand): number = previous_item.reference_number + 1 else: number = 0 - item = models.TrainingItem.objects.create(category=category, reference_number=number, name=name, description=random.choice(descriptions)) + item = models.TrainingItem.objects.create(category=category, reference_number=number, name=name, description=random.choice(descriptions) + random.choice(descriptions) + random.choice(descriptions)) self.items.append(item) def setup_levels(self): diff --git a/training/templates/item_list.xml b/training/templates/item_list.xml index 8e4f57e9..b80d5351 100644 --- a/training/templates/item_list.xml +++ b/training/templates/item_list.xml @@ -6,8 +6,10 @@ {% for category in categories %}

{{category}}

+ {% for item in category.items.all %}

{{ item }}

+ {{ item.description }} {% if item.prerequisites.exists %}

Prerequisites:

@@ -17,7 +19,7 @@ {% endfor %} {% endif %} - + {% endfor %} {% endfor %} {% endblock %}