File: pcmd.py

package info (click to toggle)
django-polymorphic 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 892 kB
  • sloc: python: 6,784; javascript: 263; makefile: 137
file content (30 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
This module is a scratchpad for general development, testing & debugging.
"""

from django.core.management.base import NoArgsCommand
from django.db import connection
from pexp.models import *


def reset_queries():
    connection.queries = []


class Command(NoArgsCommand):
    help = ""

    def handle_noargs(self, **options):
        Project.objects.all().delete()
        a = Project.objects.create(topic="John's gathering")
        b = ArtProject.objects.create(topic="Sculpting with Tim", artist="T. Turner")
        c = ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")
        print(Project.objects.all())
        print("")

        TestModelA.objects.all().delete()
        a = TestModelA.objects.create(field1="A1")
        b = TestModelB.objects.create(field1="B1", field2="B2")
        c = TestModelC.objects.create(field1="C1", field2="C2", field3="C3")
        print(TestModelA.objects.all())
        print("")