Add images to Officials
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.1.5 on 2019-10-10 16:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('webapp', '0059_auto_20191010_1900'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='official',
|
||||
name='image',
|
||||
field=models.ImageField(null=True, upload_to=''),
|
||||
),
|
||||
]
|
||||
@@ -220,6 +220,7 @@ class Official(models.Model):
|
||||
email = models.EmailField(_('Email address'))
|
||||
phone_number = PhoneNumberField(_('Phone number'))
|
||||
role_history = models.ManyToManyField('Occupation', 'officials', blank=True)
|
||||
image = models.ImageField(null=True)
|
||||
|
||||
@staticmethod
|
||||
def by_year(year):
|
||||
|
||||
@@ -110,7 +110,7 @@ class RoleSerializer(serializers.ModelSerializer):
|
||||
class ContactsSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Official
|
||||
fields = ('first_name', 'last_name', 'email', 'phone_number')
|
||||
fields = ('first_name', 'last_name', 'email', 'phone_number', 'image')
|
||||
depth = 2
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user