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.
|
|
|
from django import forms
|
|
|
|
from django.contrib.auth import models as auth_models
|
|
|
|
|
|
|
|
from .models import Article
|
|
|
|
|
|
|
|
|
|
|
|
class ArticleForm(forms.ModelForm):
|
|
|
|
link_widget = forms.TextInput(attrs={'placeholder': 'Введите ссылку новости'})
|
|
|
|
link = forms.CharField(widget=link_widget)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Article
|
|
|
|
fields = ('body', 'link',)
|
|
|
|
|
|
|
|
|
|
|
|
class UserForm(forms.ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = auth_models.User
|
|
|
|
fields = ('username', 'password',)
|
|
|
|
widgets = {
|
|
|
|
'password': forms.PasswordInput(),
|
|
|
|
}
|