You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
776 B
Python

# coding: utf-8
# Author: Grizzly
#
# Forms for litl. The main form is for creating the link.
from django import forms
from django.core.exceptions import ValidationError
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import Slug
class SlugAddForm(forms.Form):
destination = forms.CharField(label="Destination(s) ", max_length=300,required=True,widget=forms.Textarea(attrs={"rows":3}))
slug = forms.CharField(label="Slug", max_length=20,required=False)
def __init__(self, *args, **kwargs):
super(SlugAddForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.add_input(Submit('submit', 'Shorten', css_class='btn-primary'))
self.helper.form_method = 'POST'