|
4 | 4 | from django.conf import settings |
5 | 5 | from django.core.files.uploadedfile import UploadedFile |
6 | 6 | from django.core.management.base import BaseCommand |
| 7 | +from apps.about.models import Ally |
7 | 8 |
|
8 | 9 | from apps.locations.models import Venue |
9 | 10 | from apps.organizations.models import Organization |
@@ -52,6 +53,37 @@ def add_own_organization(): |
52 | 53 | ).save() |
53 | 54 |
|
54 | 55 |
|
| 56 | +def add_allies(): |
| 57 | + """ |
| 58 | + Add the Python Canarias allies, in order to work with this section |
| 59 | + """ |
| 60 | + print("Adding allies") |
| 61 | + |
| 62 | + photo_path = Path(settings.BASE_DIR) / 'apps/dev/fixtures/adalovedev.jpg' |
| 63 | + with photo_path.open('rb') as fin: |
| 64 | + photo = UploadedFile(fin, name=photo_path.name) |
| 65 | + Ally( |
| 66 | + name='AdaLoveDev', |
| 67 | + description='Somos una comunidad sin ánimo de lucro cuyo objetivo es dar visibilidad y empoderamiento a las mujeres en el sector tecnológico', |
| 68 | + logo=photo, |
| 69 | + url='https://adalovedev.es/', |
| 70 | + twitter='https://twitter.com/adalovedev', |
| 71 | + email='organization@adalovedev.es', |
| 72 | + ).save() |
| 73 | + |
| 74 | + photo_path = Path(settings.BASE_DIR) / 'apps/dev/fixtures/python-es.png' |
| 75 | + with photo_path.open('rb') as fin: |
| 76 | + photo = UploadedFile(fin, name=photo_path.name) |
| 77 | + Ally( |
| 78 | + name='Python España', |
| 79 | + description='Asociación Python España. Trabajando para promover y visibilizar el uso del lenguaje de programación Python en nuestro país', |
| 80 | + logo=photo, |
| 81 | + url='https://www.es.python.org/', |
| 82 | + twitter='https://twitter.com/python_es', |
| 83 | + email=' contacto@es.python.org', |
| 84 | + ).save() |
| 85 | + |
| 86 | + |
55 | 87 | def add_events(): |
56 | 88 | """ |
57 | 89 | Add a sample value and event so we get some content in the events page |
@@ -98,3 +130,4 @@ def handle(self, *args, **options): |
98 | 130 | add_own_organization() |
99 | 131 | add_quotes() |
100 | 132 | add_events() |
| 133 | + add_allies() |
0 commit comments