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 # Tabulate and Faker are available. from tabulate import tabulate from faker import Faker # You can place the models here class Person(models.Model): name = models.CharField(max_length=100) demo = models.BooleanField(default=False) blocked = models.BooleanField(default=False) class Organization(models.Model): name = models.CharField(max_length=100) class OrganizationPersonRelationship(models.Model): organization = models.ForeignKey(Organization, on_delete=models.CASCADE) person = models.ForeignKey(Person, on_delete=models.CASCADE) deleted = models.BooleanField(default=False) # You need a run function def run(): # At this point all migrations are created and applied john = Person.objects.create(name='John Doe') jane = Person.objects.create(name='Jane Doe') org = Organization.objects.create(name='ABC Corp') rel1 = OrganizationPersonRelationship.objects.create(organization=org, person=john) rel2 = OrganizationPersonRelationship.objects.create(organization=org, person=jane) org_persons = Person.objects.filter( organizationpersonrelationship__organization=rel1.organization, organizationpersonrelationship__deleted=False, demo=False, blocked=False, ) #org_persons = list( # OrganizationPersonRelationship.objects.filter( # organization_id=rel1.organization_id, # deleted=False, # person__demo=False, # person__blocked=False, # ).select_related('person').values_list('person', flat=True) #) for p in org_persons: print(f'Hello, {p.name}!') # Any "print" statements will be displayed in "Output" #print(f'Hello, {john.name}!') # If you return a Dict[str, List[Dict[str, Any]]], it will be displayed # as a Table below the Output Section and will be given the key as title. return { 'Org Persons': list(org_persons.values()), 'People': list(Person.objects.values()), 'Other': [ {'name': 'Cell 1', 'other': 'Cell 2'}, {'name': 'Cell 3', 'other': 'Cell 4'}, ] } # Alternatively, you can just return a list of dicts # to render a default "Data" table. # return list(Person.objects.all().values())
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