diff --git a/.gitignore b/.gitignore index b3c61fe..14b74f8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ env/ db.sqlite3 *.db *.sqlite +*.sqlite3 # 媒体文件 media/ diff --git a/core/__pycache__/admin.cpython-313.pyc b/core/__pycache__/admin.cpython-313.pyc index e83834b..4167b24 100644 Binary files a/core/__pycache__/admin.cpython-313.pyc and b/core/__pycache__/admin.cpython-313.pyc differ diff --git a/core/__pycache__/forms.cpython-313.pyc b/core/__pycache__/forms.cpython-313.pyc index cb756be..0295d7a 100644 Binary files a/core/__pycache__/forms.cpython-313.pyc and b/core/__pycache__/forms.cpython-313.pyc differ diff --git a/core/__pycache__/models.cpython-313.pyc b/core/__pycache__/models.cpython-313.pyc index 74a1eec..78d1966 100644 Binary files a/core/__pycache__/models.cpython-313.pyc and b/core/__pycache__/models.cpython-313.pyc differ diff --git a/core/__pycache__/views.cpython-313.pyc b/core/__pycache__/views.cpython-313.pyc index 6b2b47b..1071c13 100644 Binary files a/core/__pycache__/views.cpython-313.pyc and b/core/__pycache__/views.cpython-313.pyc differ diff --git a/core/forms.py b/core/forms.py index a042a89..6b7d8d6 100644 --- a/core/forms.py +++ b/core/forms.py @@ -12,12 +12,13 @@ class ReadingRecordForm(forms.ModelForm): """阅读记录表单""" class Meta: model = ReadingRecord - fields = ['type', 'title', 'source', 'progress', 'file'] + fields = ['type', 'title', 'source', 'progress', 'note', 'file'] widgets = { 'type': forms.Select(attrs={'class': 'form-select'}), 'title': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '请输入标题'}), 'source': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '请输入来源'}), 'progress': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '请输入进度'}), + 'note': forms.Textarea(attrs={'class': 'form-control', 'rows': 4, 'placeholder': '请输入阅读笔记'}), 'file': forms.FileInput(attrs={'class': 'form-control'}), } diff --git a/core/migrations/0003_readingrecord_note.py b/core/migrations/0003_readingrecord_note.py new file mode 100644 index 0000000..9de9f2d --- /dev/null +++ b/core/migrations/0003_readingrecord_note.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2026-01-05 15:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0002_familytasktype_plantype_priority_readingtype_status_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='readingrecord', + name='note', + field=models.TextField(blank=True, null=True, verbose_name='阅读笔记'), + ), + ] diff --git a/core/models.py b/core/models.py index a1f93e9..5f01760 100644 --- a/core/models.py +++ b/core/models.py @@ -78,6 +78,7 @@ class ReadingRecord(models.Model): title = models.CharField(max_length=200, verbose_name="标题") source = models.CharField(max_length=200, blank=True, null=True, verbose_name="来源") progress = models.CharField(max_length=100, blank=True, null=True, verbose_name="进度") + note = models.TextField(blank=True, null=True, verbose_name="阅读笔记") file = models.FileField(upload_to='reading_files/', blank=True, null=True, verbose_name="上传文件") created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") updated_at = models.DateTimeField(auto_now=True, verbose_name="更新时间") diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 8aaea55..943e9b6 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -67,7 +67,7 @@