DryORM
Code
Result
no cache
SQLite
PostgreSQL 17.4
MariaDB 11.4.5
Select a template
dryorm features
basic
bulk create
bulk fake
csv import
basic fk
self fk
user profile
dryorm tabular output
from django.db import models class Tag(models.Model): name = models.CharField(max_length=50, unique=True) class Article(models.Model): title = models.CharField(max_length=100) content = models.TextField() tags = models.ManyToManyField(Tag, related_name='articles') class Comment(models.Model): article = models.ForeignKey(Article, on_delete=models.CASCADE, related_name='comments') author = models.CharField(max_length=50) text = models.TextField() def run(): article = Article.objects.create( title='Django ORM Simplified', content='A quick intro to Django ORM.' ) tech = Tag.objects.create(name='Tech') news = Tag.objects.create(name='News') article.tags.add(tech, news) Comment.objects.bulk_create([ Comment(article=article, author='Alice', text='Very helpful!'), Comment(article=article, author='Bob', text='Nice and clear!') ]) comments_with_all_fields = Comment.objects.select_related('article').prefetch_related('article__tags') comments_with_only_fields = comments_with_all_fields.only('article__id') # list(comments_with_all_fields) # list(comments_with_only_fields) # What happens if we hit the omitted fields? for comment in comments_with_only_fields: print(comment.article.content)
Output
Show Template
No output.
Queries
TCL
T
DDL
D
SELECT
S
INSERT
I
UPDATE
U
DELETE
D
Queries
Q
(
0
)
No queries.
✖ Close
Save & Share
✖
private?
Save
Save & Copy