The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
#!/usr/bin/perl | |
# adapted from https://gist.github.com/bitfolk/6856343 | |
# License: None(none specified in original code) | |
# | |
# Usage: | |
# - install Perl DBI modules: | |
# - (libdbi-perl, libdbd-sqlite3-perl for ubuntu) | |
# - Run reap-dead-tracks.pl <database> |
The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
The following gist is an extract of the article Detecting Similar News. It exploit data retrieve by a crawler and detect similar article across different domains
Start by running the crawler to retrieve the data. Crawler takes about 50 minutes to retrieve all the data the first time.
$ python run.py
retrieving url... [techcrunch.com] /
#!/usr/bin/env python2 | |
#-*- coding=utf-8 -*- | |
# © 2013 Mark Harviston, BSD License | |
from __future__ import absolute_import, unicode_literals, print_function | |
""" | |
Qt data models that bind to SQLAlchemy queries | |
""" | |
from PyQt4 import QtGui | |
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt | |
import logging # noqa |
from flask import Flask | |
import flask_admin as admin | |
from flask_sqlalchemy import SQLAlchemy | |
from flask_admin.contrib import sqla | |
# Create application | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = '123456790' |