List the past submissions with information about them
181506
def list_submissions():
    """"""
    submissions = []
    try:
        submissions = session.query(Submission).all()
    except SQLAlchemyError as e:
        session.rollback()
    return render_template('list_submissions.html', submissions=submissions)
522387
def authors(self):
        '''
            
        '''
        qs = self._valid_submissions().values_list('authors',flat=True).distinct()
        return qs
333026
def create_post_history(raw_data):
        '''
        
        '''
        uid = tools.get_uuid()
        TabPostHist.create(
            uid=uid,
            title=raw_data.title,
            post_id=raw_data.uid,
            user_name=raw_data.user_name,
            cnt_md=raw_data.cnt_md,
            time_update=tools.timestamp(),
            logo=raw_data.logo,
        )
        return True
1249777
function list(params, cb) {
  var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions", params);
  var method = "GET";
  var data = {};

  params.resourcePath = resourcePath;
  params.method = method;
  params.data = data;

  mbaasRequest.admin(params, cb);
}
1067875
def submission_filenames(round_num=None, tournament=None):
    """"""
    click.echo(prettify(
        napi.get_submission_filenames(tournament, round_num)))
1072077
def later_submission_for_group(submission):
        """"""
        return (Submission
                .query_by(project=submission.project, group=submission.group)
                .filter(Submission.created_at > submission.created_at)
                .order_by(Submission.created_at).first())
877617
def submissions(self):
        """"""
        r = fapi.get_submissions(self.namespace, self.name, self.api_url)
        fapi._check_response_code(r, 200)
        return r.json()
667619
def get_submissions():
    """"""
    print(request.args.to_dict())
    print(request.args.get('search[value]'))
    print(request.args.get('draw', 1))
    # submissions  = session.query(Submission).all()
    if request.args.get('correct_filter', 'all') == 'all':
        correct_filter = [True, False]
    elif request.args['correct_filter'] == 'correct':
        correct_filter = [True]
    else:
        correct_filter = [False]
    
    if request.args.get('order[0][column]', '0') == '0':
        column = 'id'
    elif request.args['order[0][column]'] == '1':
        column = 'text'
    else:
        column = 'primary_error'
        
    order_str = "{} {}".format(column, request.args.get('order[0][dir]', 'desc'))

    search_val = request.args.get('search[value]')
    draw = request.args.get('draw', 1)
    filtered_len = session.query(Submission)\
            .filter(Submission.text.startswith(search_val))\
            .filter(Submission.correct.in_(correct_filter))\
            .count()
    subs = \
            session.query(Submission).filter(Submission.text.startswith(search_val))\
            .filter(Submission.correct.in_(correct_filter))\
            .order_by(order_str)\
            .offset(request.args.get('start', 0))\
            .limit(request.args.get('length', 10))\
            .all()
    submissions = {'draw': draw, 'recordsTotal':0, 'recordsFiltered':0, 'data':[]}
    i = 0
    for i, submission in enumerate(subs):
       submissions['data'].append([submission.id, submission.text,
           submission.primary_error, submission.correct]) 
    submissions['recordsTotal'] = session.query(Submission).count() 
    submissions['recordsFiltered'] = filtered_len 

    return jsonify(submissions)
892425
def list_records_previous_page(self):
        
        uri = self._paging.get("record", {}).get("prev_uri")
        if uri is None:
            raise exc.NoMoreResults("There are no previous pages of records "
                    "to list.")
        return self._list_records(uri)
798998
def author_list(self):
        ''' '''
        author_list = [self.submitter] + \
            [author for author in self.authors.all().exclude(pk=self.submitter.pk)]
        return ",\n".join([author.get_full_name() for author in author_list])
1166242
def list(self):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': '单页列表',
        }
        self.render('wiki_page/page_list.html',
                    kwd=kwd,
                    view=MWiki.query_recent(),
                    view_all=MWiki.query_all(),
                    format_date=tools.format_date,
                    userinfo=self.userinfo,
                    cfg=CMS_CFG)
1348544
def fetch_recent_submissions(self, max_duration):
        
        if max_duration:
            self.min_date = self.max_date - SECONDS_IN_A_DAY * max_duration
        for submission in self.subreddit.new(limit=None):
            if submission.created_utc <= self.min_date:
                break
            if submission.created_utc > self.max_date:
                continue
            self.submissions[submission.id] = MiniSubmission(submission)
713353
def top_submissions(self):
        """"""
        num = min(10, len(self.submissions))
        if num <= 0:
            return ''

        top_submissions = sorted(
            [x for x in self.submissions.values() if self.distinguished or
             x.distinguished is None],
            key=lambda x: (-x.score, -x.num_comments, x.title))[:num]

        if not top_submissions:
            return ''

        retval = self.post_header.format('Top Submissions')
        for sub in top_submissions:
            title = self._safe_title(sub)
            if sub.permalink in sub.url:
                retval += tt('1. {}').format(title)
            else:
                retval += tt('1. [{}]({})').format(title, sub.url)

            retval += ' by {} ({}, [{} comment{}]({}))\n'.format(
                self._user(sub.author), self._points(sub.score),
                sub.num_comments, 's' if sub.num_comments != 1 else '',
                self._permalink(sub))
        return tt('{}\n').format(retval)
443745
def combine_submissions(combined_submission_data, opts = {})
      data, _status_code, _headers = combine_submissions_with_http_info(combined_submission_data, opts)
      data
    end
81718
def whois_history(self, query, **kwargs):
        """"""
        return self._results('whois-history', '/v1/{0}/whois/history'.format(query), items_path=('history', ), **kwargs)
651740
def top_submitters(self, num):
        """"""
        num = min(num, len(self.submitters))
        if num <= 0:
            return ''

        top_submitters = sorted(
            iteritems(self.submitters),
            key=lambda x: (-sum(y.score for y in x[1]),
                           -len(x[1]), str(x[0])))[:num]

        retval = self.post_header.format('Top Submitters\' Top Submissions')
        for (author, submissions) in top_submitters:
            retval += '1. {}, {} submission{}: {}\n'.format(
                self._points(sum(x.score for x in submissions)),
                len(submissions),
                's' if len(submissions) != 1 else '', self._user(author))
            for sub in sorted(
                    submissions, key=lambda x: (-x.score, x.title))[:10]:
                title = self._safe_title(sub)
                if sub.permalink in sub.url:
                    retval += tt('  1. {}').format(title)
                else:
                    retval += tt('  1. [{}]({})').format(title, sub.url)
                retval += ' ({}, [{} comment{}]({}))\n'.format(
                    self._points(sub.score), sub.num_comments,
                    's' if sub.num_comments != 1 else '',
                    self._permalink(sub))
            retval += '\n'
        return retval
746315
def _get_last_entries(db, qty):
    """"""
    doc_ids = [post.doc_id for post in db.posts.all()]
    doc_ids = sorted(doc_ids, reverse=True)
    # bug: here we shoud only render doc_ids[:qty]
    # but we can't use mtimes for sorting. We'll need to add ptime for the
    # database (publish time)
    entries = [Entry(os.path.join(CONFIG['content_root'],
                     db.posts.get(doc_id=doc_id)['filename']), doc_id)
               for doc_id in doc_ids]
    # return _sort_entries(entries)[:qty]
    entries.sort(key=operator.attrgetter('date'), reverse=True)
    return entries[:qty], entries