Commit fa062dd8 authored by David Haynes's avatar David Haynes 🙆
Browse files

fix for forms not posting, minor things as well

- so you did need some of that in Meta, since those requirements were expected to be
filled the form would break since the form only fills some attributes hmm
- also can't set fields to '__all__' because of ^^ I believe
- encourage use of https
- copy doc pattern from other fields
parent d6ab20f2
...@@ -6,12 +6,13 @@ from captcha.fields import CaptchaField ...@@ -6,12 +6,13 @@ from captcha.fields import CaptchaField
class URLForm(forms.ModelForm): class URLForm(forms.ModelForm):
# Custom target URL field
target = forms.URLField( target = forms.URLField(
required=True, required=True,
label='Long URL', label='Long URL',
max_length=1000, max_length=1000,
widget=forms.URLInput(attrs={ widget=forms.URLInput(attrs={
'placeholder': 'http://' 'placeholder': 'https://'
}) })
) )
...@@ -55,7 +56,8 @@ class URLForm(forms.ModelForm): ...@@ -55,7 +56,8 @@ class URLForm(forms.ModelForm):
class Meta: class Meta:
model = URL model = URL
fields = '__all__' fields = ('target',)
exclude = ('owner', 'short', 'date_created', 'clicks', 'expires')
class SignupForm(forms.ModelForm): class SignupForm(forms.ModelForm):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment