changes display of notes in tables (headers on the side)
corrects code for 'notes' modules according to PEP8 guidelines
This commit is contained in:
@@ -6,8 +6,8 @@ from utilisateurs.models import Professionnel
|
||||
from django import forms
|
||||
from django_select2.forms import Select2Widget
|
||||
|
||||
### NOTES
|
||||
|
||||
# NOTES
|
||||
class NoteForm(forms.ModelForm):
|
||||
""" Generic Note form """
|
||||
class Meta:
|
||||
@@ -15,11 +15,12 @@ class NoteForm(forms.ModelForm):
|
||||
fields = ['sujet', 'text', 'created_by', 'created_date', 'created_time']
|
||||
widgets = {
|
||||
'sujet': Select2Widget(),
|
||||
'text': forms.Textarea(attrs={'rows':4}),
|
||||
'text': forms.Textarea(
|
||||
attrs={'rows': 4}
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
||||
class SimpleNoteForm(forms.ModelForm):
|
||||
""" Simple note with only 'sujet' and 'text' fields.
|
||||
|
||||
@@ -30,7 +31,6 @@ class SimpleNoteForm(forms.ModelForm):
|
||||
fields = ['sujet', 'text']
|
||||
|
||||
|
||||
|
||||
class UserNoteForm(NoteForm):
|
||||
""" Form that sets 'created_by' with current user id.
|
||||
|
||||
@@ -56,7 +56,6 @@ class UserNoteForm(NoteForm):
|
||||
return instance
|
||||
|
||||
|
||||
|
||||
class AutoNoteForm(UserNoteForm):
|
||||
class Meta(UserNoteForm.Meta):
|
||||
fields = ['text']
|
||||
@@ -73,21 +72,21 @@ class AutoNoteForm(UserNoteForm):
|
||||
return inst
|
||||
|
||||
|
||||
|
||||
### SUJETS
|
||||
|
||||
# SUJETS
|
||||
current_year = datetime.date.today().year
|
||||
YEAR_CHOICE = tuple(year - 2 for year in range(current_year, current_year + 10))
|
||||
|
||||
|
||||
class SujetCreateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Sujet
|
||||
fields = ['nom', 'surnom', 'prenom', 'genre', 'premiere_rencontre']
|
||||
widgets = {
|
||||
'premiere_rencontre': forms.SelectDateWidget( empty_label=("Année", "Mois", "Jour"),
|
||||
years = YEAR_CHOICE,
|
||||
),
|
||||
}
|
||||
widgets = {'premiere_rencontre': forms.SelectDateWidget(
|
||||
empty_label=("Année", "Mois", "Jour"),
|
||||
years=YEAR_CHOICE,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
class SelectSujetForm(forms.Form):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user