Skip to content

Commit d1e73cd

Browse files
committed
Add model for allies
1 parent 2ecd8c0 commit d1e73cd

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

apps/about/admin.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.contrib import admin
2+
3+
from . import models
4+
5+
6+
@admin.register(models.Ally)
7+
class AllyAdmin(admin.ModelAdmin):
8+
list_display = (
9+
'name',
10+
'url',
11+
'twitter',
12+
'email',
13+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 2.2.24 on 2021-10-12 17:37
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Ally',
16+
fields=[
17+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('name', models.CharField(max_length=120, verbose_name='Nombre')),
19+
('description', models.CharField(max_length=220, verbose_name='Descripción')),
20+
('logo', models.ImageField(blank=True, upload_to='about/allies/')),
21+
('url', models.URLField(blank=True)),
22+
('twitter', models.URLField(blank=True)),
23+
('email', models.EmailField(blank=True, max_length=254)),
24+
],
25+
),
26+
]

apps/about/models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.db import models
2+
3+
4+
class Ally(models.Model):
5+
'''Organizaciones/Asociaciones aliadas'''
6+
7+
name = models.CharField('Nombre', max_length=120)
8+
description = models.CharField('Descripción', max_length=220)
9+
logo = models.ImageField(upload_to='about/allies/', blank=True)
10+
url = models.URLField(blank=True)
11+
twitter = models.URLField(blank=True)
12+
email = models.EmailField(blank=True)

0 commit comments

Comments
 (0)