From 78272a2f778ab577d91e46e54a35835e42c21eaa Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 7 Oct 2020 09:55:32 +0200 Subject: [PATCH] minor model changes (url length) --- input/migrations/0012_auto_20201007_0754.py | 23 +++++++++++++++++++++ input/models.py | 17 ++++++--------- 2 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 input/migrations/0012_auto_20201007_0754.py diff --git a/input/migrations/0012_auto_20201007_0754.py b/input/migrations/0012_auto_20201007_0754.py new file mode 100644 index 0000000..5b4f984 --- /dev/null +++ b/input/migrations/0012_auto_20201007_0754.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.1 on 2020-10-07 07:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0011_auto_20201007_0743'), + ] + + operations = [ + migrations.AlterField( + model_name='honorarycertificate', + name='request_url', + field=models.CharField(max_length=2000), + ), + migrations.AlterField( + model_name='ifg', + name='url', + field=models.CharField(max_length=2000), + ), + ] diff --git a/input/models.py b/input/models.py index 66501c2..7c1af11 100644 --- a/input/models.py +++ b/input/models.py @@ -12,25 +12,20 @@ class Volunteer(models.Model): class Project(Volunteer): name = models.CharField(max_length=200) start = models.DateField('start date') - # contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) pid = models.IntegerField(null=True, blank=True) # automaticly generated - # @property - # def pid(self): - # pid = "hurzel " + self.get_pk - # print(pid) - # return pid def save(self,*args,**kwargs): - super().save(*args,*kwargs) - self.pid = 10000 + self.pk - super().save(*args,*kwargs) + # is there a way to call super().save() only once? + super().save(*args,*kwargs) + self.pid = 10000 + self.pk + super().save(*args,*kwargs) def __str__(self): return self.name class HonoraryCertificate(Volunteer): - request_url = models.CharField(max_length=400) #can urls be longer in theory? + request_url = models.CharField(max_length=2000) number = models.IntegerField(null = True) def __str__(self): @@ -53,7 +48,7 @@ class Library(Grant): return self.library class IFG(Grant): - url = models.CharField(max_length=400) #can urls be longer in theory? + url = models.CharField(max_length=2000) def __str__(self): return "IFG-Anfrage von " + self.realname