code stringlengths 3 6.57k |
|---|
click.option('--storys', help="story ids, separate by ','") |
update_story_has_mathjax(storys=None) |
_get_story_ids(storys) |
LOG.info('total %s storys', len(story_ids) |
tqdm.tqdm(story_ids, ncols=80, ascii=True) |
transaction.atomic() |
Story.objects.only('id', 'content', '_version') |
get(pk=story_id) |
processor.story_has_mathjax(story.content) |
story.save() |
main.command() |
update_story_is_user_marked() |
exclude(is_watched=False, is_favorited=False) |
all() |
LOG.info('total %s user marked storys', len(user_storys) |
tqdm.tqdm(user_storys, ncols=80, ascii=True) |
Story.set_user_marked_by_id(user_story.story_id) |
main.command() |
click.option('--storys', help="story ids, separate by ','") |
process_story_links(storys=None) |
_get_story_ids(storys) |
LOG.info('total %s storys', len(story_ids) |
tqdm.tqdm(story_ids, ncols=80, ascii=True) |
transaction.atomic() |
Story.objects.only('id', 'content', '_version') |
get(pk=story_id) |
processor.process_story_links(story.content, story.link) |
story.save() |
main.command() |
click.option('--storys', help="story ids, separate by ','") |
update_story_images(storys=None) |
_get_story_ids(storys) |
LOG.info('total %s storys', len(story_ids) |
tqdm.tqdm(story_ids, ncols=80, ascii=True) |
Story.objects.get(pk=story_id) |
main.command() |
click.argument('unionid_text') |
decode_unionid(unionid_text) |
unionid.decode(unionid_text) |
len(numbers) |
click.echo('user_id={} feed_id={} offset={}'.format(*numbers) |
len(numbers) |
click.echo('user_id={} feed_id={}'.format(*numbers) |
click.echo(numbers) |
main.command() |
click.option('--days', type=int, default=1) |
click.option('--limit', type=int, default=100) |
click.option('--threshold', type=int, default=99) |
delete_invalid_feeds(days=1, limit=100, threshold=99) |
count(1) |
and (status_code < 200 or status_code >= 400) |
count(1) |
count(1) |
and (status_code >= 200 and status_code < 400) |
ANY(%s) |
timezone.now() |
timezone.timedelta(days=days) |
defaultdict(dict) |
connection.cursor() |
cursor.execute(sql, [t_begin, limit]) |
cursor.fetchall() |
update(feed_id=feed_id, title=title, link=link, url=url) |
setdefault('error', {}) |
FeedResponseStatus.name_of(status_code) |
sum(error.values() |
update(ok_count=0, error_percent=100) |
cursor.execute(sql_ok_count, [t_begin, list(error_feeds) |
cursor.fetchall() |
round((feed['error_count'] / total) |
feed.update(ok_count=ok_count, error_percent=error_percent) |
list(sorted(error_feeds.values() |
delete_feed_ids.append(feed['feed_id']) |
click.echo(pretty_format_json(feed) |
click.confirm(f'Delete {len(delete_feed_ids) |
click.echo('Abort!') |
UnionFeed.bulk_delete(delete_feed_ids) |
click.echo('Done!') |
main.command() |
fix_user_story_offset() |
connection.cursor() |
cursor.execute(sql) |
cursor.fetchall() |
items.append((us_id, us_offset, story_offset) |
click.echo(f'total {len(items) |
transaction.atomic() |
tqdm.tqdm(items, ncols=80, ascii=True) |
UserStory.objects.filter(pk=us_id) |
update(offset=-us_offset) |
tqdm.tqdm(items, ncols=80, ascii=True) |
UserStory.objects.filter(pk=us_id) |
update(offset=story_offset) |
main.command() |
subscribe_changelog() |
CONFIG.root_url.rstrip('/') |
Feed.objects.get(url=changelog_url) |
click.echo(f'not found changelog feed url={changelog_url}') |
click.echo(f'changelog feed {feed}') |
get_user_model() |
list(User.objects.all() |
click.echo(f'total {len(users) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.