2019-04-12 13:15:18 +00:00
|
|
|
from django.db import models
|
2022-11-03 19:11:19 +00:00
|
|
|
from django.utils import timezone
|
|
|
|
|
|
|
|
|
|
|
|
class RelatedModel(models.Model):
|
|
|
|
simple = models.ForeignKey("SimpleModel", models.CASCADE, null=True)
|
2019-04-12 13:15:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SimpleModel(models.Model):
|
|
|
|
field = models.IntegerField()
|
2022-11-03 19:11:19 +00:00
|
|
|
created = models.DateTimeField(default=timezone.now)
|
2022-11-04 14:22:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ManyToManyModel(models.Model):
|
|
|
|
simples = models.ManyToManyField("SimpleModel")
|