Added order to charter members

This commit is contained in:
Zakary Timson 2018-01-14 21:10:47 -05:00
parent 3346a3a6ec
commit 3c5b64db0b
6 changed files with 43 additions and 2 deletions

View File

@ -12,5 +12,5 @@ class MemberAdmin(admin.ModelAdmin):
list_display = ['name', 'position', 'chapter', 'phone_formatted', 'email', 'front_page', 'joined', 'thumbnail'] list_display = ['name', 'position', 'chapter', 'phone_formatted', 'email', 'front_page', 'joined', 'thumbnail']
list_filter = ['chapter', 'position', 'front_page', 'joined'] list_filter = ['chapter', 'position', 'front_page', 'joined']
search_fields = ['email', 'joined', 'name', 'chapter', 'position', 'website', 'phone', 'phone_formatted'] search_fields = ['email', 'joined', 'name', 'chapter', 'position', 'website', 'phone', 'phone_formatted']
fields = ['image_preview', 'image', 'name', 'position', 'chapter', 'biography', 'phone', 'email', 'website', 'front_page', 'joined'] fields = ['image_preview', 'image', 'name', 'position', 'chapter', 'biography', 'phone', 'email', 'website', 'front_page', 'order', 'joined']
readonly_fields = ['image_preview'] readonly_fields = ['image_preview']

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-01-15 02:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('charter_members', '0003_auto_20180114_1722'),
]
operations = [
migrations.AddField(
model_name='attorney',
name='order',
field=models.IntegerField(blank=True, null=True, verbose_name='Order On Front Page'),
),
]

View File

@ -26,6 +26,7 @@ class Attorney(models.Model):
image = models.ImageField(upload_to='portraits', default='portraits/silhouette.png') image = models.ImageField(upload_to='portraits', default='portraits/silhouette.png')
joined = models.DateField(blank=True, null=True) joined = models.DateField(blank=True, null=True)
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
order = models.IntegerField(blank=True, null=True, verbose_name='Order On Front Page')
phone = models.CharField(max_length=10, blank=True, null=True) phone = models.CharField(max_length=10, blank=True, null=True)
position = models.ForeignKey(Position) position = models.ForeignKey(Position)
website = models.CharField(max_length=255, blank=True, null=True) website = models.CharField(max_length=255, blank=True, null=True)

View File

@ -13,7 +13,7 @@ from OACPL import settings
def index(request): def index(request):
attorneys = Attorney.objects.filter(front_page=True) attorneys = Attorney.objects.filter(front_page=True).order_by('order')
return render(request, 'index.html', {'attorneys': attorneys, 'contact': settings.EMAIL_CONTACT}) return render(request, 'index.html', {'attorneys': attorneys, 'contact': settings.EMAIL_CONTACT})

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-01-15 02:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('newsletters', '0003_subscriber_date'),
]
operations = [
migrations.AlterField(
model_name='subscriber',
name='date',
field=models.DateField(auto_now_add=True),
),
]