Skip to content

Instantly share code, notes, and snippets.

@egitimplus
Created November 5, 2020 21:20
Show Gist options
  • Save egitimplus/3eb5fe003b9d40bbb6064bab0e7212aa to your computer and use it in GitHub Desktop.
Save egitimplus/3eb5fe003b9d40bbb6064bab0e7212aa to your computer and use it in GitHub Desktop.
from django.db import models
class Car(models.Model):
name = models.CharField(max_length=255)
class Ceo(models.Model):
name = models.CharField(max_length=255, blank=True)
car = models.OneToOneField(Car, on_delete=models.CASCADE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment