Skip to content

Commit

Permalink
Merge pull request #23 from coagulant/patch-3
Browse files Browse the repository at this point in the history
Remove deprecated get_model from tasks
  • Loading branch information
fcurella committed Oct 26, 2015
2 parents 7441fd6 + d642d54 commit 222bc9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions recommends/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def _recommends_precompute():

@task(name='remove_suggestions')
def remove_suggestions(rated_model, object_id):
from django.db.models import get_model
from django.db.models import apps
from recommends.providers import recommendation_registry

ObjectClass = get_model(*rated_model.split('.'))
ObjectClass = apps.get_model(*rated_model.split('.'))
provider_instance = recommendation_registry.get_provider_for_content(
ObjectClass)
obj = ObjectClass.objects.get(pk=object_id)
Expand All @@ -48,10 +48,10 @@ def remove_suggestions(rated_model, object_id):

@task(name='remove_similarities')
def remove_similarities(rated_model, object_id):
from django.db.models import get_model
from django.db.models import apps
from recommends.providers import recommendation_registry

ObjectClass = get_model(*rated_model.split('.'))
ObjectClass = apps.get_model(*rated_model.split('.'))
provider_instance = recommendation_registry.get_provider_for_content(
ObjectClass)
obj = ObjectClass.objects.get(pk=object_id)
Expand Down

0 comments on commit 222bc9b

Please sign in to comment.