|
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
31
|
#! /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()
|