mirror of
https://github.com/Hopiu/django.git
synced 2026-03-21 16:30:25 +00:00
12 lines
298 B
Python
12 lines
298 B
Python
|
|
from django.db import models
|
||
|
|
from django.utils import timezone
|
||
|
|
|
||
|
|
|
||
|
|
class RelatedModel(models.Model):
|
||
|
|
simple = models.ForeignKey("SimpleModel", models.CASCADE, null=True)
|
||
|
|
|
||
|
|
|
||
|
|
class SimpleModel(models.Model):
|
||
|
|
field = models.IntegerField()
|
||
|
|
created = models.DateTimeField(default=timezone.now)
|