set_free_frames.py 583 Bytes
#! /usr/bin/python
# -*- coding: utf-8 -*-

import sys, os, codecs
from collections import defaultdict
from copy import deepcopy

from django.core.management.base import BaseCommand

from semantics.models import SemanticFrame

from semantics.clustering.local_db import set_free_frames

from settings import PROJECT_PATH

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

    def handle(self, **options):
        frames = SemanticFrame.objects.filter(next=None, removed=False, entry__isnull=False).order_by('id')
            
        set_free_frames(frames)