My model looks like this:
class Article(models.Model):
title = models.CharField(blank=False, null=False, max_length=200, verbose_name="title")
description = RichTextUploadingField(blank=False, null=False, verbose_name="description")
Is it possible to:
1.
Create an article with a default title='Terms and conditions'
which will be read-only in django-admin, but a description that can be modified in the django-admin?
2.
If I already have the article created, use the django shell to make the attribute read-only, like so?
python manage.py shell
from articles.models import Article
terms = Article.object.get(title='Terms and conditions')
terms.title.readonly = True
This option throws an error:
AttributeError: 'str' object has no attribute 'readonly'