Created
November 2, 2020 20:38
-
-
Save egitimplus/68a7289311a84e9d3b073ab6b7221f9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CarModel(models.Model): | |
name = models.CharField(max_length=255) | |
car = models.ForeignKey(Car, on_delete=models.SET_NULL, blank=True, null=True, related_name='models', related_query_name='model') | |
def __str__(self): | |
return self.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment