<reponame>isulim/twitter<gh_stars>0
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm

from twitter import models


class UserRegisterForm(UserCreationForm):
    email = forms.EmailField()

    class Meta:
        model = User
        fields = ['username', 'email', '<PASSWORD>', '<PASSWORD>']


class TweetForm(forms.ModelForm):
    class Meta:
        model = models.Tweet
        fields = ['content']
        widgets = {
            'content': forms.Textarea()
        }


class CommentForm(forms.ModelForm):
    class Meta:
        model = models.Comment
        fields = ['content']
        labels = False
        widgets = {
            'content': forms.Textarea(attrs={'rows': 1, 'cols': 80})
        }


class MessageForm(forms.ModelForm):
    class Meta:
        model = models.Message
        fields = ['title', 'text', 'receiver']

from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm

from twitter import models


class UserRegisterForm(UserCreationForm):
    email = forms.EmailField()

    class Meta:
        model = User
        fields = ['username', 'email', '<PASSWORD>', '<PASSWORD>']


class TweetForm(forms.ModelForm):
    class Meta:
        model = models.Tweet
        fields = ['content']
        widgets = {
            'content': forms.Textarea()
        }


class CommentForm(forms.ModelForm):
    class Meta:
        model = models.Comment
        fields = ['content']
        labels = False
        widgets = {
            'content': forms.Textarea(attrs={'rows': 1, 'cols': 80})
        }


class MessageForm(forms.ModelForm):
    class Meta:
        model = models.Message
        fields = ['title', 'text', 'receiver']