Skip to content

Commit

Permalink
removed "kell" and "fenotipo" datas
Browse files Browse the repository at this point in the history
  • Loading branch information
vcardoneit committed Nov 10, 2023
1 parent 3a296b6 commit 9a8ca65
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 127 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.5 on 2023-11-10 12:38

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('donatori', '0007_donatori_qrverify'),
]

operations = [
migrations.RemoveField(
model_name='donatori',
name='fenotipo',
),
migrations.RemoveField(
model_name='donatori',
name='kell',
),
]
2 changes: 0 additions & 2 deletions donatori/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class donatori(models.Model):
qrverify = models.CharField(max_length=32, default='')
dataiscrizione = models.DateField(null=True)
grupposang = models.CharField(max_length=3)
fenotipo = models.CharField(max_length=255)
kell = models.CharField(max_length=255)
nome = models.CharField(max_length=255)
cognome = models.CharField(max_length=255)
datadinascita = models.DateField(null=True)
Expand Down
60 changes: 12 additions & 48 deletions donatori/templates/donatori.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi Donatore</h1>
<input class="form-control" type="file" name="fototessera">
</div>
<div class="mb-3">
<label for="dataiscrizione" class="form-label">Data Iscrizione</label>
<label for="dataiscrizione" class="form-label">Data Iscrizione *</label>
<input type="date" class="form-control" name="dataiscrizione" id="dataiscrizione" required>
</div>
<div class="mb-3">
<label for="grupposanguigno" class="form-label">Gruppo Sanguigno</label>
<label for="grupposanguigno" class="form-label">Gruppo Sanguigno *</label>
<select class="form-control" name="grupposanguigno" id="grupposanguigno" required>
<option value="A+">A+</option>
<option value="A-">A-</option>
Expand All @@ -67,71 +67,39 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi Donatore</h1>
</select>
</div>
<div class="mb-3">
<label for="fenotipo" class="form-label">Fenotipo</label>
<select class="form-control" id="fenotipo" name="fenotipo" required>
<option value="CCDee">CCDee</option>
<option value="ccDEE">ccDEE</option>
<option value="CcDee">CcDee</option>
<option value="ccDEe">ccDEe</option>
<option value="ccDee">ccDee</option>
<option value="CCDEE">CCDEE</option>
<option value="CCDEe">CCDEe</option>
<option value="CcDEE">CcDEE</option>
<option value="CcDEe">CcDEe</option>
<option value="Ccddee">Ccddee</option>
<option value="CCddee">CCddee</option>
<option value="ccddEe">ccddEe</option>
<option value="ccddEE">ccddEE</option>
<option value="ccddee">ccddee</option>
<option value="CcddEe">CcddEe</option>
</select>
</div>
<div class="mb-3">
<label for="kell" class="form-label">Kell</label>
<select class="form-control" id="kell" name="kell" required>
<option value="K+k+">K+k+</option>
<option value="K+k-">K+k-</option>
<option value="K-k+">K-k+</option>
<option value="K-k-">K-k-</option>
<option value="Kp(a+b+)">Kp(a+b+)</option>
<option value="Kp(a-b+)">Kp(a-b+)</option>
<option value="Kk">Kk</option>
</select>
</div>
<div class="mb-3">
<label for="nome" class="form-label">Nome</label>
<label for="nome" class="form-label">Nome *</label>
<input type="text" class="form-control" name="nome" id="nome" required>
</div>
<div class="mb-3">
<label for="cognome" class="form-label">Cognome</label>
<label for="cognome" class="form-label">Cognome *</label>
<input type="text" class="form-control" name="cognome" id="cognome" required>
</div>
<div class="mb-3">
<label for="datadinascita" class="form-label">Data di nascita</label>
<label for="datadinascita" class="form-label">Data di nascita *</label>
<input type="date" class="form-control" name="datadinascita" id="datadinascita" required>
</div>
<div class="mb-3">
<label for="luogodinascita" class="form-label">Luogo di nascita</label>
<label for="luogodinascita" class="form-label">Luogo di nascita *</label>
<input type="text" class="form-control" name="luogodinascita" id="luogodinascita" required>
</div>
<div class="mb-3">
<label for="codicefiscale" class="form-label">Codice Fiscale</label>
<label for="codicefiscale" class="form-label">Codice Fiscale *</label>
<input type="text" class="form-control" name="codicefiscale" id="codicefiscale" maxlength="16" style="text-transform:uppercase" required>
</div>
<div class="mb-3">
<label for="indirizzo" class="form-label">Indirizzo</label>
<label for="indirizzo" class="form-label">Indirizzo *</label>
<input type="text" class="form-control" name="indirizzo" id="indirizzo" required>
</div>
<div class="mb-3">
<label for="comune" class="form-label">Comune</label>
<label for="comune" class="form-label">Comune *</label>
<input type="text" class="form-control" name="comune" id="comune" required>
</div>
<div class="mb-3">
<label for="telefono" class="form-label">Telefono</label>
<label for="telefono" class="form-label">Telefono *</label>
<input type="tel" class="form-control" name="telefono" id="telefono" maxlength="10" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<label for="email" class="form-label">Email *</label>
<input type="email" class="form-control" name="email" id="email" required>
</div>

Expand All @@ -152,8 +120,6 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi Donatore</h1>
<th scope="col" class="text-center">Cognome</th>
<th scope="col" class="text-center">Data Iscrizione</th>
<th scope="col" class="text-center">Gruppo Sanguigno</th>
<th scope="col" class="text-center">Fenotipo</th>
<th scope="col" class="text-center">Kell</th>
<th scope="col" class="text-center">Data di nascita</th>
<th scope="col" class="text-center">Luogo di nascita</th>
<th scope="col" class="text-center">Codice Fiscale</th>
Expand All @@ -171,8 +137,6 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi Donatore</h1>
<td>{{ donatore.cognome }}</td>
<td>{{ donatore.dataiscrizione|date:"d/m/Y" }}</td>
<td>{{ donatore.grupposang }}</td>
<td>{{ donatore.fenotipo }}</td>
<td>{{ donatore.kell }}</td>
<td>{{ donatore.datadinascita|date:"d/m/Y" }}</td>
<td>{{ donatore.luogodinascita }}</td>
<td>{{ donatore.codicefiscale }}</td>
Expand All @@ -195,7 +159,7 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi Donatore</h1>
url: "{% static 'datatables_it-IT.json' %}",
},
order: [
[0, 'desc']
[3, 'desc']
],
});
});
Expand Down
54 changes: 11 additions & 43 deletions donatori/templates/modifica.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ <h4 align="center">Tessera numero {{ donatore.tessera }}</h4>
<input class="form-control" type="file" name="fototessera">
</div>
<div class="mb-3">
<label for="dataiscrizione" class="form-label">Data Iscrizione</label>
<label for="dataiscrizione" class="form-label">Data Iscrizione *</label>
<input type="date" class="form-control" name="dataiscrizione" value="{{ donatore.dataiscrizione|date:'Y-m-d' }}" id="dataiscrizione" required>
</div>
<div class="mb-3">
<label for="grupposanguigno" class="form-label">Gruppo Sanguigno</label>
<label for="grupposanguigno" class="form-label">Gruppo Sanguigno *</label>
<select class="form-control" name="grupposanguigno" id="grupposanguigno" required>
<option value="A+" {% if donatore.grupposang == "A+" %}selected{% endif %}>A+</option>
<option value="A-" {% if donatore.grupposang == "A-" %}selected{% endif %}>A-</option>
Expand All @@ -29,71 +29,39 @@ <h4 align="center">Tessera numero {{ donatore.tessera }}</h4>
</select>
</div>
<div class="mb-3">
<label for="fenotipo" class="form-label">Fenotipo</label>
<select class="form-control" id="fenotipo" name="fenotipo" required>
<option value="CCDee" {% if donatore.fenotipo == "CCDee" %}selected{% endif %}>CCDee</option>
<option value="ccDEE" {% if donatore.fenotipo == "ccDEE" %}selected{% endif %}>ccDEE</option>
<option value="CcDee" {% if donatore.fenotipo == "CcDee" %}selected{% endif %}>CcDee</option>
<option value="ccDEe" {% if donatore.fenotipo == "ccDEe" %}selected{% endif %}>ccDEe</option>
<option value="ccDee" {% if donatore.fenotipo == "ccDee" %}selected{% endif %}>ccDee</option>
<option value="CCDEE" {% if donatore.fenotipo == "CCDEE" %}selected{% endif %}>CCDEE</option>
<option value="CCDEe" {% if donatore.fenotipo == "CCDEe" %}selected{% endif %}>CCDEe</option>
<option value="CcDEE" {% if donatore.fenotipo == "CcDEE" %}selected{% endif %}>CcDEE</option>
<option value="CcDEe" {% if donatore.fenotipo == "CcDEe" %}selected{% endif %}>CcDEe</option>
<option value="Ccddee" {% if donatore.fenotipo == "Ccddee" %}selected{% endif %}>Ccddee</option>
<option value="CCddee" {% if donatore.fenotipo == "CCddee" %}selected{% endif %}>CCddee</option>
<option value="ccddEe" {% if donatore.fenotipo == "ccddEe" %}selected{% endif %}>ccddEe</option>
<option value="ccddEE" {% if donatore.fenotipo == "ccddEE" %}selected{% endif %}>ccddEE</option>
<option value="ccddee" {% if donatore.fenotipo == "ccddee" %}selected{% endif %}>ccddee</option>
<option value="CcddEe" {% if donatore.fenotipo == "CcddEe" %}selected{% endif %}>CcddEe</option>
</select>
</div>
<div class="mb-3">
<label for="kell" class="form-label">Kell</label>
<select class="form-control" id="kell" name="kell" required>
<option value="K+k+" {% if donatore.kell == "K+k+" %}selected{% endif %}>K+k+</option>
<option value="K+k-" {% if donatore.kell == "K+k-" %}selected{% endif %}>K+k-</option>
<option value="K-k+" {% if donatore.kell == "K-k+" %}selected{% endif %}>K-k+</option>
<option value="K-k-" {% if donatore.kell == "K-k-" %}selected{% endif %}>K-k-</option>
<option value="Kp(a+b+)" {% if donatore.kell == "Kp(a+b+)" %}selected{% endif %}>Kp(a+b+)</option>
<option value="Kp(a-b+)" {% if donatore.kell == "Kp(a-b+)" %}selected{% endif %}>Kp(a-b+)</option>
<option value="Kk" {% if donatore.kell == "Kk" %}selected{% endif %}>Kk</option>
</select>
</div>
<div class="mb-3">
<label for="nome" class="form-label">Nome</label>
<label for="nome" class="form-label">Nome *</label>
<input type="text" class="form-control" name="nome" value="{{ donatore.nome }}" id="nome" required>
</div>
<div class="mb-3">
<label for="cognome" class="form-label">Cognome</label>
<label for="cognome" class="form-label">Cognome *</label>
<input type="text" class="form-control" name="cognome" value="{{ donatore.cognome }}" id="cognome" required>
</div>
<div class="mb-3">
<label for="datadinascita" class="form-label">Data di nascita</label>
<label for="datadinascita" class="form-label">Data di nascita *</label>
<input type="date" class="form-control" name="datadinascita" value="{{ donatore.datadinascita|date:'Y-m-d' }}" id="datadinascita" required>
</div>
<div class="mb-3">
<label for="luogodinascita" class="form-label">Luogo di nascita</label>
<label for="luogodinascita" class="form-label">Luogo di nascita *</label>
<input type="text" class="form-control" name="luogodinascita" value="{{ donatore.luogodinascita }}" id="luogodinascita" required>
</div>
<div class="mb-3">
<label for="codicefiscale" class="form-label">Codice Fiscale</label>
<label for="codicefiscale" class="form-label">Codice Fiscale *</label>
<input type="text" class="form-control" name="codicefiscale" value="{{ donatore.codicefiscale }}" id="codicefiscale" maxlength="16" style="text-transform:uppercase" required>
</div>
<div class="mb-3">
<label for="indirizzo" class="form-label">Indirizzo</label>
<label for="indirizzo" class="form-label">Indirizzo *</label>
<input type="text" class="form-control" name="indirizzo" value="{{ donatore.indirizzo }}" id="indirizzo" required>
</div>
<div class="mb-3">
<label for="comune" class="form-label">Comune</label>
<label for="comune" class="form-label">Comune *</label>
<input type="text" class="form-control" name="comune" value="{{ donatore.comune }}" id="comune" required>
</div>
<div class="mb-3">
<label for="telefono" class="form-label">Telefono</label>
<label for="telefono" class="form-label">Telefono *</label>
<input type="tel" class="form-control" name="telefono" value="{{ donatore.tel }}" id="telefono" maxlength="10" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<label for="email" class="form-label">Email *</label>
<input type="email" class="form-control" name="email" value="{{ donatore.email }}" id="email" required>
</div>

Expand Down
26 changes: 7 additions & 19 deletions donatori/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ def aggiungi(request):

lDonatori.dataiscrizione = request.POST.get('dataiscrizione')
lDonatori.grupposang = request.POST.get('grupposanguigno')
lDonatori.fenotipo = request.POST.get('fenotipo')
lDonatori.kell = request.POST.get('kell')
lDonatori.nome = request.POST.get('nome')
lDonatori.cognome = request.POST.get('cognome')
lDonatori.datadinascita = request.POST.get('datadinascita')
Expand Down Expand Up @@ -107,8 +105,6 @@ def salva(request):

lDonatori.dataiscrizione = request.POST.get('dataiscrizione')
lDonatori.grupposang = request.POST.get('grupposanguigno')
lDonatori.fenotipo = request.POST.get('fenotipo')
lDonatori.kell = request.POST.get('kell')
lDonatori.nome = request.POST.get('nome')
lDonatori.cognome = request.POST.get('cognome')
lDonatori.datadinascita = request.POST.get('datadinascita')
Expand All @@ -131,9 +127,9 @@ def esporta(request):
response = HttpResponse(content_type="text/csv", headers={"Content-Disposition": 'attachment; filename="donatori.csv"'})
lDonatori = mDonatori.objects.all()
writer = csv.writer(response)
writer.writerow(["tessera", "dataiscrizione", "grupposang", "fenotipo", "kell", "nome", "cognome", "datadinascita", "luogodinascita", "codicefiscale", "indirizzo", "comune", "tel", "email"])
writer.writerow(["tessera", "dataiscrizione", "grupposang", "nome", "cognome", "datadinascita", "luogodinascita", "codicefiscale", "indirizzo", "comune", "tel", "email"])
for x in lDonatori:
writer.writerow([x.tessera, x.dataiscrizione, x.grupposang, x.fenotipo, x.kell, x.nome, x.cognome, x.datadinascita, x.luogodinascita, x.codicefiscale, x.indirizzo, x.comune, x.tel, x.email])
writer.writerow([x.tessera, x.dataiscrizione, x.grupposang, x.nome, x.cognome, x.datadinascita, x.luogodinascita, x.codicefiscale, x.indirizzo, x.comune, x.tel, x.email])

return response
else:
Expand All @@ -158,31 +154,23 @@ def scaricaTessera(request):
font = ImageFont.truetype("./arial.ttf", font_size)

text = donatore.nome + " " + donatore.cognome
text_position = (161, 175)
text_position = (161, 225)
draw.text(text_position, text, fill=text_color, font=font)

text = str(donatore.datadinascita.strftime("%d/%m/%Y"))
text_position = (311, 225)
text_position = (311, 275)
draw.text(text_position, text, fill=text_color, font=font)

text = donatore.email
text_position = (152, 275)
text_position = (152, 325)
draw.text(text_position, text, fill=text_color, font=font)

text = donatore.grupposang
text_position = (374, 325)
draw.text(text_position, text, fill=text_color, font=font)

text = donatore.fenotipo
text_position = (205, 375)
draw.text(text_position, text, fill=text_color, font=font)

text = donatore.kell
text_position = (117, 425)
text_position = (374, 375)
draw.text(text_position, text, fill=text_color, font=font)

text = str(donatore.tessera)
text_position = (176, 475)
text_position = (176, 425)
draw.text(text_position, text, fill=text_color, font=font)

fototessera = Image.open(donatore.fototessera).resize((264, 340))
Expand Down
2 changes: 1 addition & 1 deletion donazioni/templates/donazioni.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi donazione</h1>
url: "{% static 'datatables_it-IT.json' %}",
},
order: [
[0, 'desc']
[4, 'desc']
],
});
});
Expand Down
2 changes: 1 addition & 1 deletion idoneita/templates/idoneita.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1 class="modal-title fs-5" id="staticBackdropLabel">Aggiungi Predonazione</h1>
url: "{% static 'datatables_it-IT.json' %}",
},
order: [
[0, 'desc']
[2, 'desc']
],
});
});
Expand Down
Loading

0 comments on commit 9a8ca65

Please sign in to comment.