code
stringlengths
3
6.57k
ColorTuple('#202020', '#EFEBC2')
_flat_map(func, list_)
chain.from_iterable(imap(func, list_)
RHCategoryIcon(RHDisplayCategoryBase)
undefer('icon')
_check_access(self)
_process(self)
send_file(metadata['filename'], BytesIO(self.category.icon)
RHCategoryLogo(RHDisplayCategoryBase)
undefer('logo')
_process(self)
send_file(metadata['filename'], BytesIO(self.category.logo)
RHCategoryStatistics(RHDisplayCategoryBase)
_get_stats_json(self, stats)
isoformat()
self._count_users()
jsonify(data)
_get_stats_html(self, stats)
self._process_stats(stats, root=self.category.is_root)
_process(self)
get_category_stats(self.category.id)
request.accept_mimetypes.best_match(('application/json', 'text/html')
self._get_stats_json(stats)
self._get_stats_html(stats)
_plot_data(self, stats, tooltip='')
sorted(stats.iterkeys()
now_utc()
min(min_year, years[0])
max(max_year, years[-1])
stats.get(year, 0)
xrange(min_year, max_year + 1)
ceil(max(data.itervalues()
sum(data.itervalues()
_("Years")
_process_stats(self, stats, root=False)
_('Number of events')
_('The year is the one of the start date of the event.')
self._plot_data(stats.get('events_by_year', {})
_('{value} events in {year}')
format(value='', year='')
_('Number of contributions')
_('The year is the one of the start date of the contribution.')
self._plot_data(stats.get('contribs_by_year', {})
_('{value} contributions in {year}')
format(value='', year='')
_('Number of attachments')
values.append((_('Number of users')
self._count_users()
_count_users(self)
User.find(is_deleted=False, is_pending=False)
count()
RHCategoryInfo(RHDisplayCategoryBase)
_category_query_options(cls)
subqueryload('children')
children_strategy.load_only('id', 'parent_id', 'title', 'protection_mode', 'event_creation_restricted')
children_strategy.subqueryload('acl_entries')
children_strategy.undefer('deep_children_count')
children_strategy.undefer('deep_events_count')
children_strategy.undefer('has_events')
load_only('id', 'parent_id', 'title', 'protection_mode')
subqueryload('acl_entries')
undefer('deep_children_count')
undefer('deep_events_count')
undefer('has_events')
undefer('chain')
_process(self)
serialize_category_chain(self.category, include_children=True, include_parents=True)
RHReachableCategoriesInfo(RH)
_get_reachable_categories(self, id_, excluded_ids)
Category.query.filter_by(id=id_)
options(joinedload('children')
load_only('id')
one()
filter(Category.id.in_(ids)
options(*RHCategoryInfo._category_query_options)
all()
_process(self)
set(request.json.get('exclude', set()
set()
self._get_reachable_categories(request.view_args['category_id'], excluded_ids=excluded_ids)
jsonify_data(categories=[serialize_category_chain(c, include_children=True)
RHCategorySearch(RH)
_process(self)
lower()
filter(Category.title_matches(q)
options(undefer('deep_children_count')
undefer('deep_events_count')
undefer('has_events')
joinedload('acl_entries')
query.order_by(Category.favorite_of.any(favorite_category_table.c.user_id == session.user.id)
desc()
order_by((db.func.lower(Category.title)
desc()
db.func.lower(Category.title)
startswith(q)
desc()
db.func.lower(Category.title)
query.count()
query.limit(10)
jsonify_data(categories=[serialize_category(c, with_favorite=True, with_path=True)