mirror of
https://github.com/kristoferssolo/FOSSDB.git
synced 2025-10-21 17:50:35 +00:00
Created License form
This commit is contained in:
parent
0caa73b3dc
commit
5d5944fa49
@ -1,9 +1,29 @@
|
|||||||
from django import forms
|
from django.forms import (CheckboxSelectMultiple, ModelForm,
|
||||||
|
ModelMultipleChoiceField, TextInput)
|
||||||
|
|
||||||
from .models import Project
|
from .models import License, Project
|
||||||
|
|
||||||
|
|
||||||
class ProjectForm(forms.ModelForm):
|
class ProjectForm(ModelForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Project
|
model = Project
|
||||||
fields = ["title", "description"]
|
fields = ["title", "description", "license"]
|
||||||
|
|
||||||
|
widgets = {
|
||||||
|
"title": TextInput(attrs={
|
||||||
|
"class": "form-control",
|
||||||
|
"placeholder": "Project name",
|
||||||
|
}),
|
||||||
|
"description": TextInput(attrs={
|
||||||
|
"class": "form-control",
|
||||||
|
"placeholder": "Description",
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
license = ModelMultipleChoiceField(queryset=License.objects.all(), widget=CheckboxSelectMultiple)
|
||||||
|
|
||||||
|
|
||||||
|
class LicenseForm(ModelForm):
|
||||||
|
class Meta:
|
||||||
|
model = License
|
||||||
|
fields = ["short_name", "full_name", "url", "description"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user