mirror of
https://github.com/django/django.git
synced 2024-12-28 03:55:50 +00:00
29 lines
583 B
Python
29 lines
583 B
Python
|
from django.db import models
|
||
|
|
||
|
|
||
|
class Person(models.Model):
|
||
|
name = models.CharField(max_length=200)
|
||
|
|
||
|
|
||
|
class Movie(models.Model):
|
||
|
title = models.CharField(max_length=200)
|
||
|
director = models.ForeignKey(Person)
|
||
|
|
||
|
|
||
|
class Event(models.Model):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class Screening(Event):
|
||
|
movie = models.ForeignKey(Movie)
|
||
|
|
||
|
class ScreeningNullFK(Event):
|
||
|
movie = models.ForeignKey(Movie, null=True)
|
||
|
|
||
|
|
||
|
class Package(models.Model):
|
||
|
screening = models.ForeignKey(Screening, null=True)
|
||
|
|
||
|
class PackageNullFK(models.Model):
|
||
|
screening = models.ForeignKey(ScreeningNullFK, null=True)
|