diff options
author | luxagraf <sng@luxagraf.net> | 2019-11-10 08:58:02 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-11-10 08:58:02 -0500 |
commit | c3c2664ea31f2f561893ff4e51fded995251bed9 (patch) | |
tree | 929e64c430fe463f5bb667d918d0eed1f295949b /app/jrnl | |
parent | b0112011a6dbbfd12beecb8fdcfb9e7e84808e72 (diff) |
getting rid of old books relation
Diffstat (limited to 'app/jrnl')
-rw-r--r-- | app/jrnl/admin.py | 6 | ||||
-rw-r--r-- | app/jrnl/migrations/0046_remove_entry_books.py | 17 | ||||
-rw-r--r-- | app/jrnl/models.py | 1 |
3 files changed, 20 insertions, 4 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 78a2630..1c82d25 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -22,7 +22,7 @@ class EntryAdmin(OSMGeoAdmin): def get_queryset(self, request): test_model_qs = super(EntryAdmin, self).get_queryset(request) - test_model_qs = test_model_qs.prefetch_related('related').prefetch_related('books') + test_model_qs = test_model_qs.prefetch_related('related').prefetch_related('books_new') return test_model_qs @@ -44,7 +44,7 @@ class EntryAdmin(OSMGeoAdmin): search_fields = ['title', 'body_markdown'] prepopulated_fields = {"slug": ('title',)} list_filter = ('pub_date', 'enable_comments', 'status', 'location__state__country__lux_region') - filter_horizontal = ('field_notes', 'books', 'related') + filter_horizontal = ('field_notes', 'books_new', 'related') fieldsets = ( ('Entry', { 'fields': ( @@ -74,7 +74,7 @@ class EntryAdmin(OSMGeoAdmin): ('Extra', { 'fields': ( 'field_notes', - 'books', + 'books_new', 'related', ), 'classes': ( diff --git a/app/jrnl/migrations/0046_remove_entry_books.py b/app/jrnl/migrations/0046_remove_entry_books.py new file mode 100644 index 0000000..bad9813 --- /dev/null +++ b/app/jrnl/migrations/0046_remove_entry_books.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.6 on 2019-11-10 08:57 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('jrnl', '0045_entry_books_new'), + ] + + operations = [ + migrations.RemoveField( + model_name='entry', + name='books', + ), + ] diff --git a/app/jrnl/models.py b/app/jrnl/models.py index 42b5b7d..c89791e 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -78,7 +78,6 @@ class Entry(models.Model): featured_image = models.ForeignKey(LuxImage, on_delete=models.CASCADE, null=True, blank=True) has_video = models.BooleanField(blank=True, default=False) field_notes = models.ManyToManyField(FieldNote, blank=True) - books = models.ManyToManyField(Book, blank=True) books_new = models.ManyToManyField(Book, related_name="luxbooks", blank=True) related = models.ManyToManyField(OldRelatedPost, blank=True) |