Adding the core applications code to the repository

This commit is contained in:
artus
2016-08-05 10:41:43 +02:00
parent 243ff9153e
commit 5f4faf46ec
155 changed files with 13176 additions and 0 deletions

20
notes/forms.py Normal file
View File

@@ -0,0 +1,20 @@
from .models import Note
from django import forms
from django_select2.forms import Select2Widget
from django.forms import Textarea
class NoteForm(forms.ModelForm):
class Meta:
model = Note
fields = ['sujet', 'text']
widgets = {
'sujet': Select2Widget(),
'text': Textarea(attrs={'rows':4}),
}
def save(self, *args, **kwargs):
# Get data for extra fields of Note
return super().save(*args, **kwargs)