mirror of
https://github.com/kristoferssolo/FOSSDB.git
synced 2025-10-21 17:50:35 +00:00
Change CharFiled to URLField
This commit is contained in:
parent
90debba248
commit
f995959286
@ -1,26 +1,26 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
|
|
||||||
from .hosting_platform.models import HostingPlatform, ProjectHostingPlatform
|
from .hosting_platform.models import HostingPlatform
|
||||||
|
|
||||||
from .models import Project
|
from .models import Project
|
||||||
|
|
||||||
|
|
||||||
class ProjectForm(forms.ModelForm):
|
class ProjectForm(forms.ModelForm):
|
||||||
hosting_platform = forms.ModelChoiceField(queryset=HostingPlatform.objects.all())
|
hosting_platform = forms.ModelChoiceField(queryset=HostingPlatform.objects.all())
|
||||||
url = forms.CharField(max_length=100)
|
url = forms.URLField(max_length=100)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Project
|
model = Project
|
||||||
fields = (
|
fields = (
|
||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
|
"url",
|
||||||
|
"hosting_platform",
|
||||||
"license",
|
"license",
|
||||||
"tag",
|
"tag",
|
||||||
"operating_system",
|
"operating_system",
|
||||||
)
|
)
|
||||||
|
|
||||||
exclude = ("hosting_platform",)
|
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"name": forms.TextInput(
|
"name": forms.TextInput(
|
||||||
attrs={
|
attrs={
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user