You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
365 B
Python
14 lines
365 B
Python
5 years ago
|
from django.forms import ModelForm
|
||
|
from .models import Entry
|
||
|
|
||
|
|
||
|
class EntryForm(ModelForm):
|
||
|
class Meta:
|
||
|
model = Entry
|
||
|
fields = ('text', )
|
||
|
|
||
|
def __init__(self, *args, **kwargs):
|
||
|
super().__init__(*args, **kwargs)
|
||
|
self.fields['text'].widget.attrs.update(
|
||
|
{'class': 'textarea', 'placeholder': 'What\'s on your mind?'})
|