Remove date_added field in Gallery
This commit is contained in:
parent
80085edeeb
commit
2ef6dd2a44
3 changed files with 26 additions and 7 deletions
|
|
@ -5,9 +5,9 @@ from .models import Gallery, Photo, Tag
|
|||
|
||||
|
||||
class GalleryAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'date_added', 'photo_count', 'is_public')
|
||||
list_filter = ['date_added', 'is_public']
|
||||
date_hierarchy = 'date_added'
|
||||
list_display = ('title', 'date_start', 'photo_count', 'is_public')
|
||||
list_filter = ['date_start', 'is_public']
|
||||
date_hierarchy = 'date_start'
|
||||
prepopulated_fields = {'slug': ('title',)}
|
||||
model = Gallery
|
||||
autocomplete_fields = ['photos', 'tags']
|
||||
|
|
|
|||
21
photologue/migrations/0002_auto_20220130_1020.py
Normal file
21
photologue/migrations/0002_auto_20220130_1020.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Generated by Django 3.2.11 on 2022-01-30 10:20
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('photologue', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='gallery',
|
||||
options={'get_latest_by': 'date_start', 'ordering': ['-date_start'], 'verbose_name': 'gallery', 'verbose_name_plural': 'galleries'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gallery',
|
||||
name='date_added',
|
||||
),
|
||||
]
|
||||
|
|
@ -136,8 +136,6 @@ class TagField(models.CharField):
|
|||
|
||||
|
||||
class Gallery(models.Model):
|
||||
date_added = models.DateTimeField(_('date published'),
|
||||
default=now)
|
||||
title = models.CharField(_('title'),
|
||||
max_length=250,
|
||||
unique=True)
|
||||
|
|
@ -172,8 +170,8 @@ class Gallery(models.Model):
|
|||
blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-date_added']
|
||||
get_latest_by = 'date_added'
|
||||
ordering = ['-date_start']
|
||||
get_latest_by = 'date_start'
|
||||
verbose_name = _('gallery')
|
||||
verbose_name_plural = _('galleries')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue