--- /dev/null
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('quotes', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='author',
+ name='notes',
+ field=models.TextField(blank=True),
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('quotes', '0002_author_notes'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='author',
+ name='notes',
+ field=models.TextField(help_text=b'Notes for the author; may be left blank. Will not be HTML-escaped.', blank=True),
+ ),
+ ]
class Author(models.Model):
name = models.CharField(max_length=100)
+ notes = models.TextField(blank=True, help_text= \
+ "Notes for the author; may be left blank. Will \
+ not be HTML-escaped.")
def __unicode__(self):
return self.name
{% block body %}
-
<h1>{{ author.name }}</h1>
+{% include "quotes/author_notes.html" with author=author %}
+
<p>All the quotes for {{ author.name }}:<p>
{% for quote in author.quote_set.all %}
--- /dev/null
+{% if author.notes %}
+<div class="author_notes">
+ <p>{{ author.notes|safe }}</p>
+</div>
+{% endif %}
{% include "quotes/display.html" with quote=quote %}
+{% include "quotes/author_notes.html" with author=quote.author %}
+
{% endblock %}