Minor update
This commit is contained in:
parent
c302214924
commit
74fc13f5cd
|
@ -9,6 +9,7 @@ media
|
|||
*.yaml
|
||||
*.json
|
||||
staticfiles/
|
||||
.coverage
|
||||
|
||||
# Python #
|
||||
*.py[cod]
|
||||
|
|
|
@ -75,6 +75,12 @@ Ajoutez les lignes suivantes :
|
|||
omit = *__init__.py,*/migrations/*,*test*,*settings*,*urls*,*wsgi*,manage.py,*apps*
|
||||
```
|
||||
|
||||
#### Utilisation
|
||||
|
||||
```bash
|
||||
coverage run -m pytest
|
||||
```
|
||||
|
||||
|
||||
## Déploiement sur Heroku
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
"""All global variables to avoid circular import."""
|
||||
|
||||
INJURY_MECHANISM_CHOICE = (
|
||||
INJURY_MECHANISM_CHOICE = [
|
||||
(0, "Overuse"),
|
||||
(1, "Trauma"),
|
||||
)
|
||||
]
|
||||
|
||||
INJURY_BODY_SIDE_CHOICE = (
|
||||
INJURY_BODY_SIDE_CHOICE = [
|
||||
(0, "Not Applicable"),
|
||||
(1, "Left"),
|
||||
(2, "Right"),
|
||||
(3, "Both"),
|
||||
)
|
||||
]
|
||||
|
||||
INJURY_TYPE_CHOICE = (
|
||||
INJURY_TYPE_CHOICE = [
|
||||
(0, "Abrasion"),
|
||||
(1, "Dental Injury"),
|
||||
(2, "Dislocation / Subluxation"),
|
||||
|
@ -26,9 +26,9 @@ INJURY_TYPE_CHOICE = (
|
|||
(10, "Other Bone Injury"),
|
||||
(11, "Sprain / Ligament Injury"),
|
||||
(12, "Tendon Injury / Rupture / Tendinosis / Bursitis"),
|
||||
)
|
||||
]
|
||||
|
||||
INJURY_LOCATION_CHOICE = (
|
||||
INJURY_LOCATION_CHOICE = [
|
||||
(0, "Abdomen"),
|
||||
(1, "Ankle"),
|
||||
(2, "Elbow"),
|
||||
|
@ -45,9 +45,9 @@ INJURY_LOCATION_CHOICE = (
|
|||
(13, "Thigh"),
|
||||
(14, "Upper arm"),
|
||||
(15, "Wrist"),
|
||||
)
|
||||
]
|
||||
|
||||
ROUTINE_TYPE_CHOICE = (
|
||||
ROUTINE_TYPE_CHOICE = [
|
||||
(0, "Other"),
|
||||
(1, "Q1R1"),
|
||||
(2, "Q1R2"),
|
||||
|
@ -60,17 +60,17 @@ ROUTINE_TYPE_CHOICE = (
|
|||
(9, "SFS"),
|
||||
(9, "FS"),
|
||||
(99, "Other"),
|
||||
)
|
||||
]
|
||||
|
||||
LEARNING_STEP_CHOICES = (
|
||||
LEARNING_STEP_CHOICES = [
|
||||
(0, "No"),
|
||||
(1, "With help"),
|
||||
(2, "Without help"),
|
||||
(3, "Chained"),
|
||||
(4, "Masterised"),
|
||||
)
|
||||
]
|
||||
|
||||
CHRONO_TYPE_CHOICE = (
|
||||
CHRONO_TYPE_CHOICE = [
|
||||
(0, "10 |"),
|
||||
(1, "Q1R1"),
|
||||
(2, "Q1R2"),
|
||||
|
@ -78,12 +78,12 @@ CHRONO_TYPE_CHOICE = (
|
|||
(4, "SF"),
|
||||
(5, "F"),
|
||||
(99, "Other"),
|
||||
)
|
||||
]
|
||||
|
||||
SCORE_TYPE_CHOICE = (
|
||||
SCORE_TYPE_CHOICE = [
|
||||
(0, "Chrono"),
|
||||
(1, "ToF"),
|
||||
)
|
||||
]
|
||||
|
||||
CATEGORY_CHOICES = {
|
||||
9: "I9",
|
||||
|
@ -100,29 +100,153 @@ CATEGORY_CHOICES = {
|
|||
25: "B Senior",
|
||||
}
|
||||
|
||||
AGE_CATOGORY_CHOICES = (
|
||||
AGE_CATOGORY_CHOICES = [
|
||||
(11, "11-12"),
|
||||
(13, "13-14"),
|
||||
(15, "15-16"),
|
||||
(17, "17-21"),
|
||||
(22, "Senior"),
|
||||
)
|
||||
]
|
||||
|
||||
NOTE_STATUS_CHOICES = (
|
||||
NOTE_STATUS_CHOICES = [
|
||||
(0, "Draft"),
|
||||
(1, "Published"),
|
||||
)
|
||||
]
|
||||
|
||||
GENDER_CHOICES = (
|
||||
GENDER_CHOICES = [
|
||||
(0, "Female"),
|
||||
(1, "Male"),
|
||||
)
|
||||
]
|
||||
|
||||
ORIENTATION_CHOICES = (
|
||||
ORIENTATION_CHOICES = [
|
||||
(None, "Unknown"),
|
||||
(1, "Left"),
|
||||
(2, "Right"),
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
# INJURY_MECHANISM_CHOICE = {
|
||||
# 0: "Overuse",
|
||||
# 1: "Trauma",
|
||||
# }
|
||||
|
||||
# INJURY_BODY_SIDE_CHOICE = {
|
||||
# 0: "Not Applicable",
|
||||
# 1: "Left",
|
||||
# 2: "Right",
|
||||
# 3: "Both",
|
||||
# }
|
||||
|
||||
# INJURY_TYPE_CHOICE = {
|
||||
# 0: "Abrasion",
|
||||
# 1: "Dental Injury",
|
||||
# 2: "Dislocation / Subluxation",
|
||||
# 3: "Fracture",
|
||||
# 4: "Haematoma / Contusion / Bruise",
|
||||
# 5: "Head Concussion",
|
||||
# 6: "Laceration",
|
||||
# 7: "Lesion of Meniscus or Cartilage",
|
||||
# 8: "Muscle Rupture / Strain / Tear / Cramps",
|
||||
# 9: "Nerve Injury",
|
||||
# 10: "Other Bone Injury",
|
||||
# 11: "Sprain / Ligament Injury",
|
||||
# 12: "Tendon Injury / Rupture / Tendinosis / Bursitis",
|
||||
# }
|
||||
|
||||
# INJURY_LOCATION_CHOICE = {
|
||||
# 0: "Abdomen",
|
||||
# 1: "Ankle",
|
||||
# 2: "Elbow",
|
||||
# 3: "Foot / Toe",
|
||||
# 4: "Hand / Finger / Thumb",
|
||||
# 5: "Head / Face",
|
||||
# 6: "Hip / Groin",
|
||||
# 7: "Knee",
|
||||
# 8: "Low back / Sacrum / Pelvis",
|
||||
# 9: "Lower Leg / Achilles Tendon",
|
||||
# 10: "Neck / Cervical Spine",
|
||||
# 11: "Shoulder / Clavicula",
|
||||
# 12: "Sternum / Ribs / Upper back",
|
||||
# 13: "Thigh",
|
||||
# 14: "Upper arm",
|
||||
# 15: "Wrist",
|
||||
# }
|
||||
|
||||
# ROUTINE_TYPE_CHOICE = {
|
||||
# 1: "Q1R1",
|
||||
# 2: "Q1R2",
|
||||
# 3: "Q2R1",
|
||||
# 4: "SF",
|
||||
# 5: "F",
|
||||
# 6: "Q1R1S",
|
||||
# 7: "Q1R2S",
|
||||
# 8: "Q2R1S",
|
||||
# 9: "SFS",
|
||||
# 10: "FS",
|
||||
# 99: "Other",
|
||||
# }
|
||||
|
||||
# LEARNING_STEP_CHOICES = {
|
||||
# 0: "No",
|
||||
# 1: "With help",
|
||||
# 2: "Without help",
|
||||
# 3: "Chained",
|
||||
# 4: "Masterised",
|
||||
# }
|
||||
|
||||
# CHRONO_TYPE_CHOICE = {
|
||||
# 0: "10 |",
|
||||
# 1: "Q1R1",
|
||||
# 2: "Q1R2",
|
||||
# 3: "Q2R1",
|
||||
# 4: "SF",
|
||||
# 5: "F",
|
||||
# 99: "Other",
|
||||
# }
|
||||
|
||||
# SCORE_TYPE_CHOICE = {
|
||||
# 0: "Chrono",
|
||||
# 1: "ToF",
|
||||
# }
|
||||
|
||||
# CATEGORY_CHOICES = {
|
||||
# 9: "I9",
|
||||
# 10: "I10",
|
||||
# 11: "A11",
|
||||
# 12: "A12",
|
||||
# 13: "A13-14",
|
||||
# 15: "A Junior",
|
||||
# 18: "A Senior",
|
||||
# 21: "B11",
|
||||
# 22: "B12",
|
||||
# 23: "B13-14",
|
||||
# 24: "B Junior",
|
||||
# 25: "B Senior",
|
||||
# }
|
||||
|
||||
# AGE_CATOGORY_CHOICES = {
|
||||
# 11: "11-12",
|
||||
# 13: "13-14",
|
||||
# 15: "15-16",
|
||||
# 17: "17-21",
|
||||
# 22: "Senior",
|
||||
# }
|
||||
|
||||
# NOTE_STATUS_CHOICES = {
|
||||
# 0: "Draft",
|
||||
# 1: "Published",
|
||||
# }
|
||||
|
||||
# GENDER_CHOICES = {
|
||||
# 0: "Female",
|
||||
# 1: "Male",
|
||||
# }
|
||||
|
||||
# ORIENTATION_CHOICES = {
|
||||
# None: "Unknown",
|
||||
# 1: "Left",
|
||||
# 2: "Right",
|
||||
# }
|
||||
|
||||
# MOD_THOMAS_TEST_CHOICES = (
|
||||
# (0, "not evaluated"),
|
||||
|
|
|
@ -557,10 +557,10 @@ class Passe(Markdownizable):
|
|||
|
||||
operation_list = regexp.split(" ")
|
||||
|
||||
if operation_list.count() >= 3:
|
||||
if len(operation_list) >= 3:
|
||||
return False
|
||||
|
||||
if operation_list.count() == 2:
|
||||
if len(operation_list) == 2:
|
||||
if operation_list[0] in ROUTINE_TYPE_CHOICE:
|
||||
if re.match(r"\[[1-9]*\-[1-9]*\]", operation_list[1]):
|
||||
content = operation_list[1].replace("[", "").replace("]", "")
|
||||
|
@ -576,13 +576,10 @@ class Passe(Markdownizable):
|
|||
else:
|
||||
return False
|
||||
else:
|
||||
if operation_list[0] == "WC" and educatives_list.count() == 2:
|
||||
if operation_list[0] == "WC" and len(educatives_list) == 2:
|
||||
return True
|
||||
|
||||
if (
|
||||
re.match(r"[1-9]+\|", operation_list[0])
|
||||
and educatives_list.count() >= 1
|
||||
):
|
||||
if re.match(r"[1-9]+\|", operation_list[0]) and len(educatives_list) >= 1:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue