Completed
Pull Request — master (#51)
by Paolo
07:25
created

zooma.management.commands.annotate_organismpart   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A Command.handle() 0 4 2
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
"""
4
Created on Wed May  9 11:25:09 2018
5
6
@author: Paolo Cozzi <[email protected]>
7
"""
8
9
import logging
10
11
from django.core.management.base import BaseCommand
12
from image_app.models import DictUberon
13
from zooma.helpers import annotate_organismpart
14
15
# Get an instance of a logger
16
logger = logging.getLogger(__name__)
17
18
19
class Command(BaseCommand):
20
    help = 'Call zooma for dictbreed object. Fill table if possible'
21
22
    def handle(self, *args, **options):
23
        # get all species without a term
24
        for part in DictUberon.objects.filter(term__isnull=True):
25
            annotate_organismpart(part)
26