Browse Source

minor model changes (url length)

master
Benni Baermann 4 years ago
parent
commit
78272a2f77
2 changed files with 29 additions and 11 deletions
  1. +23
    -0
      input/migrations/0012_auto_20201007_0754.py
  2. +6
    -11
      input/models.py

+ 23
- 0
input/migrations/0012_auto_20201007_0754.py View 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),
),
]

+ 6
- 11
input/models.py View File

@ -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

Loading…
Cancel
Save