diff options
author | Andrea Lepori <aleporia@gmail.com> | 2023-07-24 13:41:51 +0200 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2023-07-24 13:41:52 +0200 |
commit | b8513cbb8059400b825fd74c9bfff3142201d3c4 (patch) | |
tree | c0632648ea27ebab5de038163a2b25f8e131c269 /client/models.py | |
parent | better usercode debug formatting (diff) | |
download | scout-subs-b8513cbb8059400b825fd74c9bfff3142201d3c4.tar.gz scout-subs-b8513cbb8059400b825fd74c9bfff3142201d3c4.zip |
show all docs for all owned ucs
Diffstat (limited to '')
-rw-r--r-- | client/models.py | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/client/models.py b/client/models.py index c9fe42f..1548893 100644 --- a/client/models.py +++ b/client/models.py @@ -66,7 +66,38 @@ class MedicalData(models.Model): health_care_certificate = models.FileField(default=None, upload_to='documents/', null=True)
+class Keys(models.Model):
+ container = models.ForeignKey(
+ DocumentType, db_index=True, on_delete=models.CASCADE)
+ key = models.CharField(max_length=2048, db_index=True)
+ key_extra = models.CharField(max_length=2048, default="")
+
+
+class UserCode(models.Model):
+ user = models.ForeignKey(User, default=None, on_delete=models.CASCADE)
+ medic = models.ForeignKey(MedicalData, default=None, on_delete=models.PROTECT)
+ code = models.IntegerField(default=0)
+ branca = models.ForeignKey(Group, default=1, on_delete=models.PROTECT)
+ first_name = models.CharField(default="", max_length=250)
+ last_name = models.CharField(default="", max_length=250)
+ email = models.CharField(default="", max_length=250)
+ parent_name = models.CharField(default="", max_length=250)
+ via = models.CharField(default="", max_length=250)
+ cap = models.CharField(default="", max_length=250)
+ country = models.CharField(default="", max_length=250)
+ nationality = models.CharField(default="", max_length=250)
+ born_date = models.DateField(null=True, default=datetime.fromtimestamp(0))
+ home_phone = models.CharField(default="", max_length=250)
+ phone = models.CharField(default="", max_length=250)
+ school = models.CharField(default="", max_length=250)
+ year = models.IntegerField(default=0)
+ avs_number = models.CharField(default="", max_length=250)
+ midata_id = models.IntegerField(default=0)
+ midata_token = models.CharField(default="", max_length=1024)
+
+
class Document(models.Model):
+ usercode = models.ForeignKey(UserCode, default=1, on_delete=models.CASCADE)
user = models.ForeignKey(User, default=None, on_delete=models.CASCADE)
group = models.ForeignKey(Group, default=None, on_delete=models.CASCADE)
code = models.IntegerField(default=0)
@@ -97,35 +128,6 @@ class KeyVal(models.Model): value = models.CharField(max_length=2048, db_index=True)
-class Keys(models.Model):
- container = models.ForeignKey(
- DocumentType, db_index=True, on_delete=models.CASCADE)
- key = models.CharField(max_length=2048, db_index=True)
- key_extra = models.CharField(max_length=2048, default="")
-
-
-class UserCode(models.Model):
- user = models.ForeignKey(User, default=None, on_delete=models.CASCADE)
- medic = models.ForeignKey(MedicalData, default=None, on_delete=models.PROTECT)
- code = models.IntegerField(default=0)
- branca = models.ForeignKey(Group, default=0, on_delete=models.PROTECT)
- first_name = models.CharField(default="", max_length=250)
- last_name = models.CharField(default="", max_length=250)
- email = models.CharField(default="", max_length=250)
- parent_name = models.CharField(default="", max_length=250)
- via = models.CharField(default="", max_length=250)
- cap = models.CharField(default="", max_length=250)
- country = models.CharField(default="", max_length=250)
- nationality = models.CharField(default="", max_length=250)
- born_date = models.DateField(null=True, default=datetime.fromtimestamp(0))
- home_phone = models.CharField(default="", max_length=250)
- phone = models.CharField(default="", max_length=250)
- school = models.CharField(default="", max_length=250)
- year = models.IntegerField(default=0)
- avs_number = models.CharField(default="", max_length=250)
- midata_id = models.IntegerField(default=0)
- midata_token = models.CharField(default="", max_length=1024)
-
class GroupSettings(models.Model):
group = models.ForeignKey(Group, default=None, on_delete=models.CASCADE)
view_documents = models.BooleanField(default=False)
|