how to join models from another app

Solutions on MaxInterview for how to join models from another app by the best coders in the world

showing results for - "how to join models from another app"
Lylia
25 Nov 2020
1from django.db import models
2from geography.models import ZipCode
3
4class Restaurant(models.Model):
5    # ...
6    zip_code = models.ForeignKey(
7        ZipCode,
8        on_delete=models.SET_NULL,
9        blank=True,
10        null=True,
11    )
12