Blame view

semantics/management/commands/add_RELAT_relation.py 652 Bytes
Tomasz Bartosiak authored
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
#! /usr/bin/python
# -*- coding: utf-8 -*-

from django.core.management.base import BaseCommand
from settings import PROJECT_PATH

from semantics.models import SelectivePreferenceRelations

RELATIONS = [(-1, 'RELAT')]

#==========================================================#
class Command(BaseCommand):
    args = 'none'
    help = ''

    def handle(self, **options):
        import_relations()

def import_relations():
    relations = []
    for pid, name in RELATIONS:
        r = SelectivePreferenceRelations(plwn_id=pid, name=name)
        relations.append(r)

    SelectivePreferenceRelations.objects.bulk_create(relations)