diff options
author | luxagraf <sng@luxagraf.net> | 2016-03-09 10:46:39 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-03-09 10:46:39 -0500 |
commit | 86bb919d5e87b33f93c2d09c6fe36eb2f393b7e6 (patch) | |
tree | b6d91242b8b0159ff82d97a292b46d6db94d6b0c /app | |
parent | d8dc66e53ab94add45e61d38940a2c27baf34194 (diff) |
Hid title field on change form since I can pick it up from the entry
title
Diffstat (limited to 'app')
-rw-r--r-- | app/jrnl/admin.py | 3 | ||||
-rw-r--r-- | app/jrnl/models.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 4a241b4..7ab5f05 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -18,7 +18,8 @@ class EntryAsideAdmin(admin.ModelAdmin): @admin.register(EntryTitleSong) class EntryTitleSongAdmin(admin.ModelAdmin): list_display = ('title', 'band', 'album', 'song') - exclude = ('body_html', 'slug', 'pub_date') + list_filter = ('band',) + exclude = ('title', 'body_html', 'slug', 'pub_date') class EntryAdmin(OSMGeoAdmin): diff --git a/app/jrnl/models.py b/app/jrnl/models.py index d2e9248..834b643 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -170,7 +170,7 @@ class Entry(models.Model): class EntryTitleSong(models.Model): - title = models.CharField(max_length=200) + title = models.CharField(max_length=200, blank=True) band = models.CharField(max_length=200) album = models.CharField(max_length=200, blank=True, null=True) song = models.CharField(max_length=200, blank=True, null=True) @@ -193,6 +193,7 @@ class EntryTitleSong(models.Model): if not self.id and not self.pub_date: self.pub_date = datetime.datetime.now() self.slug = slugify(self.title) + self.title = self.entry.title super(EntryTitleSong, self).save() |