Skip to content

Instantly share code, notes, and snippets.


vitorfs/ Secret

Created Sep 30, 2017
What would you like to do?
from django import forms
from .models import Topic, Post
class NewTopicForm(forms.ModelForm):
message = forms.CharField(
attrs={'rows': 5, 'placeholder': 'What is in your mind?'}
help_text='The max length of the text is 4000.'
class Meta:
model = Topic
fields = ['subject', 'message']
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['message', ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment