From 9d07e8a26657542c98535abb7812d83a98839918 Mon Sep 17 00:00:00 2001 From: Alvin Li Date: Sun, 18 Aug 2013 00:52:06 +0800 Subject: * improved 'indicator.views.follow_indicator()', renamed to 'indicator_fanduf()' due to name conflict * finished 'search' function for page indicator NewDeleteIndex.html * added 'apps/utils/search_tools.py': some tools to process search results * renamed 'sciblog/templatetags/tools.py' to 'get_range.py' * added 'format_data()' to indicator.tools': to format data of record/confine, make it properly display in html page; * 'indicator/javascripts/new_delete_index.js': added global 'var added_indexes_id' to track the already added indexes * added 'indicator/templatetags/divisible_by.py' filter to check if a number can be extactly divide by another number; * fixed the 'index_card_fir/index_card_sec' problem of 'act_card_container' of page 'SheetDefault.html' * indicator/static/css/new_delete_index.css: added 'index_search_error' and 'index_error' * fixed 'unit.dump' problems in 'indicator.models' * 'indicator.tools': o added 'RI_TYPES', 'RI_WEIGHTS' o added 'type' in the return value of 'calc_indicator_weight()' and 'recommend_indicator()' * added field 'followedHistories' in 'indicator.models.UserIndicator' * moved 'follow_indicator()' and 'unfollow_indicator()' from 'indicator.views' to 'indicator.tools' TODO: * highcharts: draw chart for indicator records; * add/edit data, and submit (page format design) * followed indicator submit buttion --- 97suifangqa/apps/sciblog/fixtures/initial_data.json | 4 ++-- 97suifangqa/apps/sciblog/templatetags/get_range.py | 7 +++++++ 97suifangqa/apps/sciblog/templatetags/tools.py | 7 ------- 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 97suifangqa/apps/sciblog/templatetags/get_range.py delete mode 100644 97suifangqa/apps/sciblog/templatetags/tools.py (limited to '97suifangqa/apps/sciblog') diff --git a/97suifangqa/apps/sciblog/fixtures/initial_data.json b/97suifangqa/apps/sciblog/fixtures/initial_data.json index 6038ffe..dc7daec 100644 --- a/97suifangqa/apps/sciblog/fixtures/initial_data.json +++ b/97suifangqa/apps/sciblog/fixtures/initial_data.json @@ -248,8 +248,8 @@ "sample": [], "indicators": [ 3, - 2, - 1 + 1, + 2 ], "type": 1 } diff --git a/97suifangqa/apps/sciblog/templatetags/get_range.py b/97suifangqa/apps/sciblog/templatetags/get_range.py new file mode 100644 index 0000000..9ed90c2 --- /dev/null +++ b/97suifangqa/apps/sciblog/templatetags/get_range.py @@ -0,0 +1,7 @@ +from django import template + +register = template.Library() +@register.filter +def get_range(count, start = 0): + return range(start, start + count) + diff --git a/97suifangqa/apps/sciblog/templatetags/tools.py b/97suifangqa/apps/sciblog/templatetags/tools.py deleted file mode 100644 index 9ed90c2..0000000 --- a/97suifangqa/apps/sciblog/templatetags/tools.py +++ /dev/null @@ -1,7 +0,0 @@ -from django import template - -register = template.Library() -@register.filter -def get_range(count, start = 0): - return range(start, start + count) - -- cgit v1.2.2