Comments (1)
I am also having this issue.
from active_alchemy import SQLAlchemy
from flask import Flask
app = Flask(__name__)
db = SQLAlchemy('mysql+mysqldb://admin:[email protected]:3306/my_database', app=app)
event_participants = db.Table(
'event_participants', db.metadata,
db.Column('event_id', db.Integer, db.ForeignKey('events.id')),
db.Column('person_id', db.Integer, db.ForeignKey('persons.id')))
class Event(db.Model):
__tablename__ = 'events'
id = db.Column(db.Integer, primary_key=True)
participants = db.relationship('Person',
secondary='event_participants',
backref='participating')
class Person(db.Model):
__tablename__ = 'persons'
id = db.Column(db.Integer, primary_key=True)
if __name__ == '__main__':
app.run()
When I run this tiny representative example code I get the following warning:
$ python example.py
/path/to/my/site-packages/sqlalchemy/sql/base.py:291: SAWarning: Can't validate argument 'bind_key'; can't locate any SQLAlchemy dialect named 'bind'
(k, dialect_name))
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
In this example I am setting up a many-to-many relationship between events and persons. Meaning 1) there can be many events a person is participating in and 2) many persons can be attending an event. Documentation for setting up this kind of relationship with SQLAlchemy can be found here: http://docs.sqlalchemy.org/en/latest/orm/basic_relationships.html#many-to-many which is what the structure for my example code is based on.
from active-alchemy.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active-alchemy.