minor model changes (url length)
This commit is contained in:
parent
90e2bf5411
commit
78272a2f77
2 changed files with 29 additions and 11 deletions
23
input/migrations/0012_auto_20201007_0754.py
Normal file
23
input/migrations/0012_auto_20201007_0754.py
Normal file
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -12,16 +12,11 @@ class Volunteer(models.Model):
|
||||||
class Project(Volunteer):
|
class Project(Volunteer):
|
||||||
name = models.CharField(max_length=200)
|
name = models.CharField(max_length=200)
|
||||||
start = models.DateField('start date')
|
start = models.DateField('start date')
|
||||||
# contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True)
|
|
||||||
|
|
||||||
pid = models.IntegerField(null=True, blank=True) # automaticly generated
|
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):
|
def save(self,*args,**kwargs):
|
||||||
|
# is there a way to call super().save() only once?
|
||||||
super().save(*args,*kwargs)
|
super().save(*args,*kwargs)
|
||||||
self.pid = 10000 + self.pk
|
self.pid = 10000 + self.pk
|
||||||
super().save(*args,*kwargs)
|
super().save(*args,*kwargs)
|
||||||
|
@ -30,7 +25,7 @@ class Project(Volunteer):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
class HonoraryCertificate(Volunteer):
|
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)
|
number = models.IntegerField(null = True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -53,7 +48,7 @@ class Library(Grant):
|
||||||
return self.library
|
return self.library
|
||||||
|
|
||||||
class IFG(Grant):
|
class IFG(Grant):
|
||||||
url = models.CharField(max_length=400) #can urls be longer in theory?
|
url = models.CharField(max_length=2000)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "IFG-Anfrage von " + self.realname
|
return "IFG-Anfrage von " + self.realname
|
||||||
|
|
Loading…
Reference in a new issue