A
A
Alexander2016-04-09 14:57:40
Django
Alexander, 2016-04-09 14:57:40

Is it possible to set placeholder in models.CharField?

class NewsLetter(models.Model):
    email = models.EmailField()
    full_name = models.CharField(max_length=200, placeholder="Text!")
    timestamp = models.DateField(auto_now_add=True, auto_now=False)
    updated = models.DateField(auto_now_add=False, auto_now=True)

How can I set a placeholder in a model? Or only through forms.py ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pan Propan, 2016-04-09
@kentuck1213

placeholder is used on the front, respectively, and you can set it through widgets, that is, in forms.py.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question