Did I find the right examples for you? yes no

All Samples(4)  |  Call(0)  |  Derive(0)  |  Import(4)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/d/j/django-dash-0.4.4/src/dash/contrib/plugins/news/forms.py   django-dash(Download)
from dash.base import DashboardPluginFormBase
from dash.widgets import BooleanRadioSelect
from dash.contrib.plugins.news.defaults import DEFAULT_MAX_NEWS_ITEMS, DEFAULT_TRUNCATE_AFTER, DEFAULT_CACHE_FOR
from dash.contrib.plugins.rss_feed.defaults import DEFAULT_SHOW_TITLE
 
    plugin_data_fields = [
        ("show_title", DEFAULT_SHOW_TITLE),
        ("max_items", DEFAULT_MAX_NEWS_ITEMS),
        ("truncate_after", DEFAULT_TRUNCATE_AFTER),
        ("cache_for", DEFAULT_CACHE_FOR)
    ]
    show_title = forms.BooleanField(label=_("Show title?"), required=False, initial=DEFAULT_SHOW_TITLE, \
                                    widget=BooleanRadioSelect)
    max_items = forms.IntegerField(label=_("Max feed items to show"), required=True, initial=DEFAULT_MAX_NEWS_ITEMS)

src/d/j/django-dash-HEAD/src/dash/contrib/plugins/news/forms.py   django-dash(Download)
from dash.base import DashboardPluginFormBase
from dash.widgets import BooleanRadioSelect
from dash.contrib.plugins.news.defaults import DEFAULT_MAX_NEWS_ITEMS, DEFAULT_TRUNCATE_AFTER, DEFAULT_CACHE_FOR
from dash.contrib.plugins.rss_feed.defaults import DEFAULT_SHOW_TITLE
 
    plugin_data_fields = [
        ("show_title", DEFAULT_SHOW_TITLE),
        ("max_items", DEFAULT_MAX_NEWS_ITEMS),
        ("truncate_after", DEFAULT_TRUNCATE_AFTER),
        ("cache_for", DEFAULT_CACHE_FOR)
    ]
    show_title = forms.BooleanField(label=_("Show title?"), required=False, initial=DEFAULT_SHOW_TITLE, \
                                    widget=BooleanRadioSelect)
    max_items = forms.IntegerField(label=_("Max feed items to show"), required=True, initial=DEFAULT_MAX_NEWS_ITEMS)

src/d/j/django-dash-0.4.4/src/dash/contrib/plugins/news/views.py   django-dash(Download)
from dash.contrib.plugins.news.models import NewsItem
from dash.contrib.plugins.news.constants import MAX_NUM_POSTS_LISTING, PAGE_URL_PARAM, NUM_POSTS_URL_PARAM
from dash.contrib.plugins.news.defaults import DEFAULT_MAX_NEWS_ITEMS
 
@csrf_exempt
    page = request.GET.get(PAGE_URL_PARAM, 1)
    #import ipdb; ipdb.set_trace()
    num_posts = request.GET.get(NUM_POSTS_URL_PARAM, DEFAULT_MAX_NEWS_ITEMS)
 
    try:
        num_posts = int(num_posts)
    except Exception as e:
        num_posts = DEFAULT_MAX_NEWS_ITEMS
 
    if num_posts < 1 or num_posts > MAX_NUM_POSTS_LISTING:
        num_posts = DEFAULT_MAX_NEWS_ITEMS
 
    paginator = Paginator(queryset, num_posts, allow_empty_first_page=False)

src/d/j/django-dash-HEAD/src/dash/contrib/plugins/news/views.py   django-dash(Download)
from dash.contrib.plugins.news.models import NewsItem
from dash.contrib.plugins.news.constants import MAX_NUM_POSTS_LISTING, PAGE_URL_PARAM, NUM_POSTS_URL_PARAM
from dash.contrib.plugins.news.defaults import DEFAULT_MAX_NEWS_ITEMS
 
@csrf_exempt
    page = request.GET.get(PAGE_URL_PARAM, 1)
    #import ipdb; ipdb.set_trace()
    num_posts = request.GET.get(NUM_POSTS_URL_PARAM, DEFAULT_MAX_NEWS_ITEMS)
 
    try:
        num_posts = int(num_posts)
    except Exception as e:
        num_posts = DEFAULT_MAX_NEWS_ITEMS
 
    if num_posts < 1 or num_posts > MAX_NUM_POSTS_LISTING:
        num_posts = DEFAULT_MAX_NEWS_ITEMS
 
    paginator = Paginator(queryset, num_posts, allow_empty_first_page=False)