Created
November 5, 2020 21:26
-
-
Save egitimplus/7708b2034552507cd8b0a8dff8ca6fd3 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
| from django.db import models | |
| from polymorphic.models import PolymorphicModel | |
| class Drive(PolymorphicModel): | |
| name = models.CharField(max_length=255) | |
| class TwoWheelDrive(Drive): | |
| pass | |
| class FourWheelDrive(Drive): | |
| pass | |
| class Car(models.Model): | |
| name = models.CharField(max_length=255) | |
| drive = models.ManyToManyField(Drive) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment