Skip to content

Instantly share code, notes, and snippets.

View Anirudhchoudhary's full-sized avatar
🏠
Working from home

Anirudh Anirudhchoudhary

🏠
Working from home
View GitHub Profile
@Anirudhchoudhary
Anirudhchoudhary / .py
Created October 8, 2025 09:29
Coding ORM.
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=255)
website = models.URLField(null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Job(models.Model):
company = models.ForeignKey(Company, on_delete=models.CASCADE)