add_RELAT_relation.py 652 Bytes
#! /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)