Skip to content

Commit

Permalink
Update to version v2.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed Jan 23, 2017
1 parent 819a546 commit 2ea0951
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

2.9.6 (2017-01-23)
------------------

* Add a page size parameter to `get_pagination_vars`


2.9.5 (2015-12-14)
------------------

Expand Down
2 changes: 1 addition & 1 deletion django_lets_go/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Arezqui Belaid <[email protected]>
#

__version__ = '2.9.5'
__version__ = '2.9.6'
__author__ = "Arezqui Belaid"
__contact__ = "[email protected]"
__homepage__ = "http://www.star2billing.com/"
Expand Down
20 changes: 12 additions & 8 deletions django_lets_go/common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def pass_gen(char_length, digit_length):


def current_view(request):
#from inspect import getmodule
#name = getmodule(stack()[1][0]).__name__
# from inspect import getmodule
# name = getmodule(stack()[1][0]).__name__
return stack()[1][3]


Expand All @@ -55,7 +55,7 @@ def striplist(l):
return([x.strip() for x in l])


#related to date manipulation
# related to date manipulation
def relative_days(from_day, from_year):
"""get relative days from day & year (with leap year check)
Expand Down Expand Up @@ -183,7 +183,7 @@ def validate_days(year, month, day):
31
"""
total_days = calendar.monthrange(year, month)
return ( total_days[1] if (day > total_days[1]) else day )
return (total_days[1] if (day > total_days[1]) else day)


def month_year_range(enter_date):
Expand Down Expand Up @@ -258,7 +258,7 @@ def get_news(news_url):
return news_final


#variable check with request
# variable check with request
def variable_value(request, field_name):
"""Check field in POST/GET request and return field value
Expand Down Expand Up @@ -448,7 +448,7 @@ def ceil_strdate(str_date, start, hour_min=False):
(hour, minute, second, millisec) = (0, 0, 0, 0)
else:
(hour, minute, second, millisec) = (23, 59, 59, 999999)
#if hour_min then we will retrieve them from str_date
# if hour_min then we will retrieve them from str_date
if hour_min:
return datetime(int(str_date[0:4]), int(str_date[5:7]), int(str_date[8:10]),
int(str_date[11:13]), int(str_date[14:16]), 0, 0)
Expand All @@ -457,10 +457,14 @@ def ceil_strdate(str_date, start, hour_min=False):
minute, second, millisec)


def get_pagination_vars(request, col_field_list, default_sort_field):
def get_pagination_vars(request, col_field_list, default_sort_field, param_page_size=None):
"""Return data for django pagination with sort order"""
# Define no of records per page
PAGE_SIZE = settings.PAGE_SIZE
if param_page_size:
PAGE_SIZE = param_page_size
else:
PAGE_SIZE = settings.PAGE_SIZE

PAGE_NUMBER = int(request.GET.get('page', 1))

# page index
Expand Down
2 changes: 1 addition & 1 deletion update_version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Usage:
# ./update_version.sh 2.9.3
# ./update_version.sh 2.9.6
#

git flow release start v$1
Expand Down

0 comments on commit 2ea0951

Please sign in to comment.