Skip to content

Commit

Permalink
Remove cached_entities(). Fixes #307
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Jun 26, 2018
1 parent 2e17435 commit ec08fa6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
7 changes: 0 additions & 7 deletions docs/source/modules/tcms.core.helpers.cache.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/modules/tcms.core.helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ Submodules

.. toctree::

tcms.core.helpers.cache
tcms.core.helpers.comments

23 changes: 0 additions & 23 deletions tcms/core/helpers/cache.py

This file was deleted.

9 changes: 4 additions & 5 deletions tcms/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
from django.shortcuts import render
from django.views.decorators.http import require_GET

from tcms.core.helpers.cache import cached_entities
from tcms.core.utils.raw_sql import RawSQL
from tcms.management.models import Priority
from tcms.management.models import Priority, Product
from tcms.search.forms import CaseForm, RunForm, PlanForm
from tcms.search.order import order_targets
from tcms.search.query import SmartDjangoQuery
from tcms.testcases.models import TestCase
from tcms.testplans.models import TestPlan
from tcms.testplans.models import TestPlan, PlanType
from tcms.testruns.models import TestRun


Expand All @@ -43,9 +42,9 @@ def advance_search(request):

if errors or not data:
product_choice = []
for product in cached_entities('product'):
for product in Product.objects.all():
product_choice.append((product.pk, product.name))
plan_type_choices = cached_entities('plantype') # pylint: disable=unused-variable
plan_type_choices = PlanType.objects.all() # pylint: disable=unused-variable
errors = _fmt_errors(errors)
priorities = Priority.objects.filter( # pylint: disable=unused-variable
is_active=True).order_by('value')
Expand Down
9 changes: 4 additions & 5 deletions tcms/search/forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
from django import forms

from tcms.core.helpers.cache import cached_entities
from tcms.management.models import Product, Build, Component, Version
from tcms.management.models import Product, Priority, Build, Component, Version
from tcms.testcases.forms import BugField
from tcms.testcases.models import Category
from tcms.testcases.models import Category, TestCaseStatus
from tcms.testplans.models import PlanType


Expand Down Expand Up @@ -141,12 +140,12 @@ def clean_cs_tester(self):

def populate(self, data):
status_choices = []
for test_case_status in cached_entities('TestCaseStatus'):
for test_case_status in TestCaseStatus.objects.all():
status_choices.append((test_case_status.pk, test_case_status.name))
self.fields['cs_status'].choices = status_choices

priority_choices = []
for priority in cached_entities('Priority'):
for priority in Priority.objects.all():
priority_choices.append((priority.pk, priority.value))
self.fields['cs_priority'].choices = priority_choices

Expand Down

0 comments on commit ec08fa6

Please sign in to comment.