#! /usr/bin/python # -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from settings import PROJECT_PATH from semantics.models import SemanticRole, Complement, SemanticRolesDisplay #==========================================================# class Command(BaseCommand): args = 'none' help = '' def handle(self, **options): POL_role() def POL_role(): role = SemanticRole(role='Lemma', color='256,256,256', gradient=None) role.save() display = SemanticRolesDisplay(row=5, column=1, rowspan=1, colspan=4) display.save() display.roles.add(role) display.save()