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.
21 lines
556 B
Python
21 lines
556 B
Python
# coding: utf-8
|
|
# Author: Grizzly
|
|
#
|
|
# Forms for litl. The main form is for creating the link.
|
|
|
|
from django import forms
|
|
from crispy_forms.helper import FormHelper
|
|
from crispy_forms.layout import Submit
|
|
from .models import Slug
|
|
|
|
class SlugAddForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Slug
|
|
fields = ('destination','slug')
|
|
|
|
def __init__(self,*args,**kwargs):
|
|
super().__init__(*args,**kwargs)
|
|
self.helper = FormHelper()
|
|
self.helper.form_method = 'post'
|
|
self.helper.add_input(Submit('submit','Shorten'))
|