Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #285 from chop-dbhi/issue-216
Browse files Browse the repository at this point in the history
Remove lexicon package
  • Loading branch information
bruth committed Jan 16, 2015
2 parents eede2d9 + fccf895 commit adcd3a8
Show file tree
Hide file tree
Showing 18 changed files with 280 additions and 256 deletions.
4 changes: 2 additions & 2 deletions avocado/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class Haystack(Dependency):
# and returns the error for downstream use.
def _test(self):
try:
import haystack # noqa
except (ImportError, ImproperlyConfigured), e:
import haystack # noqa
except (ImportError, ImproperlyConfigured) as e:
return e

def test_install(self):
Expand Down
Empty file removed avocado/lexicon/__init__.py
Empty file.
28 changes: 0 additions & 28 deletions avocado/lexicon/managers.py

This file was deleted.

37 changes: 0 additions & 37 deletions avocado/lexicon/models.py

This file was deleted.

1 change: 0 additions & 1 deletion avocado/management/commands/avocado.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Command(BaseCommand):
'data': 'data',
'cache': 'cache',
'legacy': 'legacy',
'lexicon': 'lexicon',
'history': 'history',
'migration': 'migration',
}
Expand Down
30 changes: 8 additions & 22 deletions avocado/management/subcommands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from django.core.management.base import BaseCommand
from avocado.conf import dep_supported
from avocado.models import DataField, DataConcept, DataCategory
from avocado.lexicon.models import Lexicon
from avocado.core import utils


Expand Down Expand Up @@ -62,8 +61,6 @@ class Command(BaseCommand):
OneToOneField,
)

ignored_lexicon_fields = ('value', 'order', 'label', 'code')

def handle(self, *args, **options):
"Handles app_label or app_label.model_label formats."

Expand Down Expand Up @@ -132,17 +129,15 @@ def handle(self, *args, **options):
pending_models.extend(get_models(app))

for model in pending_models:
lexicon = issubclass(model, Lexicon)

if dep_supported('objectset'):
from objectset.models import ObjectSet
objectset = issubclass(model, ObjectSet)
is_objectset = issubclass(model, ObjectSet)
else:
objectset = False
is_objectset = False

model_name = model._meta.object_name.lower()

if lexicon or objectset:
if is_objectset:
pk = model._meta.pk
pk.verbose_name = model._meta.verbose_name
pending_fields.append((pk, model_name, app_name))
Expand Down Expand Up @@ -188,15 +183,12 @@ def handle_field(self, field, model_name, app_name, **options):

if dep_supported('objectset'):
from objectset.models import ObjectSet
objectset = issubclass(field.model, ObjectSet)
is_objectset = issubclass(field.model, ObjectSet)
else:
objectset = False

lexicon = issubclass(field.model, Lexicon)
is_objectset = False

# Lexicons and ObjectSets are represented via their primary key, so
# these may pass
if not objectset and not lexicon:
# ObjectSets are represented by their primary key, so these may pass
if not is_objectset:
# Check for primary key, and foreign key fields
if isinstance(field, self.key_field_types) and not include_keys:
print(u'({0}) {1}.{2} is a primary or foreign key. Skipping...'
Expand Down Expand Up @@ -226,13 +218,7 @@ def handle_field(self, field, model_name, app_name, **options):
'field_name': field.name,
}

if lexicon:
kwargs.update({
'label_field_name': 'label',
'order_field_name': 'order',
'code_field_name': 'code',
})
elif objectset and hasattr(field.model, 'label_field'):
if is_objectset and hasattr(field.model, 'label_field'):
kwargs.update({
'label_field_name': field.model.label_field
})
Expand Down
54 changes: 0 additions & 54 deletions avocado/management/subcommands/lexicon.py

This file was deleted.

Loading

0 comments on commit adcd3a8

Please sign in to comment.