Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

forms.py 430B

1234567891011121314151617
  1. from django import forms
  2. from datetime import datetime
  3. from .models import Post, CustomUser
  4. from django.forms import ModelForm, ValidationError
  5. from taggit.forms import *
  6. class PostForm(forms.ModelForm):
  7. class Meta:
  8. model = Post
  9. fields = ('title', 'text', 'published_date','tags')
  10. class NewTagForm(forms.ModelForm):
  11. tags = TagField()
  12. class Meta:
  13. model = CustomUser
  14. fields = ['tags']