final final final final final version (version 1.5)
This commit is contained in:
@@ -16,12 +16,11 @@ class BundleForm(forms.ModelForm):
|
||||
("Accessory", "Accessorio"),
|
||||
("Computer", "Computer")
|
||||
)
|
||||
product_type = forms.ChoiceField(choices=type_choices, initial="")
|
||||
delivery_date = forms.DateField(widget=SelectDateWidget(), initial=datetime.now().date() )
|
||||
product_type = forms.ChoiceField(choices=type_choices, initial="", label= "Tipo prodotto")
|
||||
delivery_date = forms.DateField(widget=SelectDateWidget(), initial=datetime.now().date(), label="Data di Consegna")
|
||||
class Meta:
|
||||
model = Bundle
|
||||
fields = "__all__"
|
||||
|
||||
labels = {
|
||||
"product_type": "Tipo Prodotto",
|
||||
"product_name": "Nome Prodotto",
|
||||
@@ -219,8 +218,14 @@ class ResignationForm(forms.ModelForm):
|
||||
|
||||
|
||||
class StudentForm(forms.ModelForm):
|
||||
choice=(
|
||||
("ok","Ok"),
|
||||
("resigned", "Dimesso")
|
||||
)
|
||||
|
||||
birth_date = forms.DateField(widget=SelectDateWidget(), label="Data di Nascita")
|
||||
resignation_date = forms.DateField(widget=SelectDateWidget(), label="Data di Dimissioni:")
|
||||
resignation_date = forms.DateField(widget=SelectDateWidget(), required=False, label="Data di Dimissioni:")
|
||||
student_status = forms.ChoiceField(choices=choice, label="Status Studente")
|
||||
class Meta:
|
||||
model = Student
|
||||
fields= "__all__"
|
||||
@@ -248,7 +253,7 @@ class StudentForm(forms.ModelForm):
|
||||
"nation_birth": "Nazione di Nascita",
|
||||
"course_id": "Corso"
|
||||
}
|
||||
exclude = ["course_acronym", "course_code", "course_status", "course_year", "course_name"]
|
||||
exclude = ["course_code", "course_status", "course_year", "course_name"]
|
||||
|
||||
|
||||
class AssignmentComputerForm(forms.Form):
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
{% if user.is_authenticated %}
|
||||
|
||||
<div class="detail-content">
|
||||
{% if bundle.product_type == "Computer" %}
|
||||
<a href="/import/serials" class="pure-button pure-button-primary add-button">Importa Computer</a>
|
||||
{% endif %}
|
||||
<div class="detail-content">
|
||||
<table class="pure-table pure-table-horizontal width-100">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<p>{{ err_str }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h3>Stai modificando: </h3>
|
||||
<h3>Stai modificando lo studente {{ id }}:</h3>
|
||||
<form action="/edit/student/{{ id }}" method="post" enctype="multipart/form-data" class="pure-form pure-form-2 pure-form-stacked">
|
||||
{% csrf_token %}
|
||||
<div class="from-content width-100">
|
||||
|
||||
@@ -132,7 +132,7 @@ def assignment_cespite(request):
|
||||
computer = get_object_or_404(Computer, serial=form["serial"])
|
||||
computer_copy = copy.deepcopy(computer)
|
||||
computer.cespite = form["cespite"]
|
||||
computer.save
|
||||
computer.save()
|
||||
|
||||
record.date = datetime.now().date()
|
||||
record.action = "assignment"
|
||||
|
||||
@@ -11,7 +11,7 @@ from ..models import Bundle, Supplier, Student, Course, Ticket
|
||||
|
||||
@user_passes_test(lambda u: u.is_superuser or u.is_staff)
|
||||
def storage(request):
|
||||
bundles = Bundle.objects.all()
|
||||
bundles = Bundle.objects.all().order_by("-id")
|
||||
if request.method == "GET":
|
||||
return render(request, "gestionale/list/storage.html", {
|
||||
"bundles": bundles
|
||||
@@ -31,7 +31,7 @@ def suppliers(request):
|
||||
|
||||
@user_passes_test(lambda u: u.is_superuser or u.is_staff)
|
||||
def students(request):
|
||||
students = Student.objects.all().order_by("course_acronym")
|
||||
students = Student.objects.all().order_by("course_id")
|
||||
if request.method == "GET":
|
||||
return render(request, "gestionale/list/students.html", {
|
||||
"students": students
|
||||
|
||||
Reference in New Issue
Block a user