Change CharFiled to URLField

This commit is contained in:
Kristofers Solo 2023-06-25 14:04:18 +00:00
parent 90debba248
commit f995959286

View File

@ -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={