src/polymorphic/tests/other/models.py
raw| 1 | from polymorphic.tests.models import Participant |
| 2 | from django.db import models |
| 3 | |
| 4 | |
| 5 | class UserProfile(Participant): |
| 6 | participant = models.OneToOneField( |
| 7 | Participant, parent_link=True, on_delete=models.CASCADE, related_name="other_userprofile" |
| 8 | ) |
| 9 | name = models.CharField(max_length=100) |
| 10 | |
| 11 | def __str__(self): |
| 12 | return self.name |