Skip to content

Instantly share code, notes, and snippets.

View iho's full-sized avatar
🏠
Working from home

iho iho

🏠
Working from home
  • Kyiv, Ukraine
  • 23:57 (UTC +02:00)
View GitHub Profile
@iho
iho / flask-admin many-to-many search.md
Last active August 29, 2015 14:26 — forked from riteshreddyr/flask-admin many-to-many search.md
Flask-admin Many-to-Many Search and Filtering

#Flask-admin Many-to-Many Search

Many-to-Many searches are not easily supported by Flask-admin. Read Here for more info

##Solution

  • Add the association tables to the list of join tables so that the join between the two tables can be made through the association table.
  • Reverse the tables to ensure that the association tables are processed before the other join table.

Tested on Flask-Admin 1.1.0

@iho
iho / ckedit.py
Last active August 29, 2015 14:22 — forked from mrjoes/ckedit.py
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin, wtf
from flask.ext.admin.contrib import sqlamodel
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.sqlite'
db = SQLAlchemy(app)
@iho
iho / ckedit.py
Last active August 29, 2015 14:22 — forked from dengshuan/ckedit.py
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin
from wtforms import TextAreaField
from wtforms.widgets import TextArea
from flask.ext.admin.contrib.sqla import ModelView
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'