forms.py 378 Bytes
Newer Older
1
from __future__ import unicode_literals
2

3 4
from django import forms

5
from .models import Author
6 7 8 9 10 11 12 13


class AuthorForm(forms.ModelForm):
    name = forms.CharField()
    slug = forms.SlugField()

    class Meta:
        model = Author
14
        fields = ['name', 'slug']
15 16 17 18 19


class ContactForm(forms.Form):
    name = forms.CharField()
    message = forms.CharField(widget=forms.Textarea)