Skip to content

Instantly share code, notes, and snippets.

View mcardozo's full-sized avatar
🏠
Working from home

Marisol Cardozo mcardozo

🏠
Working from home
View GitHub Profile
@mcardozo
mcardozo / through_relationships.py
Created April 18, 2021 14:25 — forked from jhgaylor/through_relationships.py
Example of using a through model in Django and filtering by a value on the custom through model.
class A(models.Model):
things = models.ManyToManyField("B", through=ThroughModel)
class B(models.Model):
text = models.TextField()
class ThroughModel(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey(B)
extra = models.BooleanField()
@mcardozo
mcardozo / local.yml
Created January 5, 2021 19:14
Envío de emails con django, mailhog y celery
version: '3.8'
services:
mailhog:
image: mailhog/mailhog:v1.0.0
container_name: mailhog
expose:
- 1025
- 8025
ports: