123456789101112131415161718192021222324 |
- from django import forms
- from datetime import datetime
-
- from .models import Post, CustomUser
- from django.forms import ModelForm, ValidationError
-
- from taggit.forms import *
-
-
- #extended code customised
- #import from https://tutorial.djangogirls.org/en/django_forms/
- class PostForm(forms.ModelForm):
-
- class Meta:
- model = Post
- fields = ('title', 'text', 'published_date','tags')
-
-
- class NewTagForm(forms.ModelForm):
- tags = TagField()
-
- class Meta:
- model = CustomUser
- fields = ['tags']
|