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 .hosting_platform.models import HostingPlatform, ProjectHostingPlatform
from .hosting_platform.models import HostingPlatform
from .models import Project
class ProjectForm(forms.ModelForm):
hosting_platform = forms.ModelChoiceField(queryset=HostingPlatform.objects.all())
url = forms.CharField(max_length=100)
url = forms.URLField(max_length=100)
class Meta:
model = Project
fields = (
"name",
"description",
"url",
"hosting_platform",
"license",
"tag",
"operating_system",
)
exclude = ("hosting_platform",)
widgets = {
"name": forms.TextInput(
attrs={