Blame view

semantics/management/commands/update_semantic_frames.py 577 Bytes
Bartłomiej Nitoń authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/python
# -*- coding: utf-8 -*-

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

from semantics.models import SemanticFrame, Complement

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

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

def update_semantic_frames():
    frames = SemanticFrame.objects.all()
    for frame in frames:
        frame.complements = Complement.objects.filter(frame__id=frame.id)
        frame.save()