| 1 |
""" |
| 2 |
This module is a scratchpad for general development, testing & debugging. |
| 3 |
""" |
| 4 |
|
| 5 |
from django.core.management.base import NoArgsCommand |
| 6 |
from django.db import connection |
| 7 |
from pexp.models import * |
| 8 |
|
| 9 |
|
| 10 |
def reset_queries(): |
| 11 |
connection.queries = [] |
| 12 |
|
| 13 |
|
| 14 |
class Command(NoArgsCommand): |
| 15 |
help = "" |
| 16 |
|
| 17 |
def handle_noargs(self, **options): |
| 18 |
Project.objects.all().delete() |
| 19 |
a = Project.objects.create(topic="John's gathering") |
| 20 |
b = ArtProject.objects.create(topic="Sculpting with Tim", artist="T. Turner") |
| 21 |
c = ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter") |
| 22 |
print(Project.objects.all()) |
| 23 |
print("") |
| 24 |
|
| 25 |
TestModelA.objects.all().delete() |
| 26 |
a = TestModelA.objects.create(field1="A1") |
| 27 |
b = TestModelB.objects.create(field1="B1", field2="B2") |
| 28 |
c = TestModelC.objects.create(field1="C1", field2="C2", field3="C3") |
| 29 |
print(TestModelA.objects.all()) |
| 30 |
print("") |