1 from django.db import models
3 class Area(models.Model):
4 name = models.CharField(max_length=64)
5 notes = models.TextField()
7 class Crag(models.Model):
8 area = models.ForeignKey(Area, on_delete=models.CASCADE)
9 name = models.CharField(max_length=64)
10 notes = models.TextField()
12 class Route(models.Model):
13 area = models.ForeignKey(Crag, on_delete=models.CASCADE)
14 name = models.CharField(max_length=64)
15 notes = models.TextField()
17 ROUTE_DIFFICULTY_CHOICES = (
67 class Pitch(models.Model):
68 route = models.ForeignKey(Route, on_delete=models.CASCADE)
69 name = models.CharField(max_length=64, null=True)
70 difficulty = models.CharField(max_length=5, choices=ROUTE_DIFFICULTY_CHOICES)
71 safety = models.CharField(max_length=4, choices=SAFETY_CHOICES)
72 notes = models.TextField()
74 class Cluster(models.Model):
75 area = models.ForeignKey(Area, on_delete=models.CASCADE)
76 name = models.CharField(max_length=64)
77 notes = models.TextField()
79 class Boulder(models.Model):
80 cluster = models.ForeignKey(Cluster, on_delete=models.CASCADE)
81 name = models.CharField(max_length=64)
82 notes = models.TextField()
84 BOULDER_DIFFICULTY_CHOICES = (
105 class Problem(models.Model):
106 boulder = models.ForeignKey(Boulder, on_delete=models.CASCADE)
107 name = models.CharField(max_length=64)
108 difficulty = models.CharField(max_length=3, choices=BOULDER_DIFFICULTY_CHOICES)
109 safety = models.CharField(max_length=4, choices=SAFETY_CHOICES)
110 notes = models.TextField()