-
-
Save vitorfs/3dd5ed2b3e27b4c12886e9426acf8fda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from .models import Topic, Post | |
class NewTopicForm(forms.ModelForm): | |
message = forms.CharField( | |
widget=forms.Textarea( | |
attrs={'rows': 5, 'placeholder': 'What is in your mind?'} | |
), | |
max_length=4000, | |
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