Comments (5)
Am traveling this week. Will have time to look early next week if no one else is available to triage this
from sqlalchemy.
Law of twos with #11321
from sqlalchemy.
the correct parameter for setting the tablename on a decalrative base is __tablename__
, not tablename
. Fixing that, your program fails because you have an errant comma in your table definition:
sqlalchemy.exc.NoForeignKeysError: Can't find any foreign key relationships between '('subusers',)' and 'instance_subuser'.
^^^^^^^^^^^ note tuple here
class SubUser(Base):
tablename = 'subusers',
^^^ errant comma here
id = Column(Integer, primary_key = True)
instances = relationship('Instance', secondary = InstanceSubuserRelationShipTable, back_populates='subusers')
# Irrelevant parameters here...
from sqlalchemy.
Ironically it wasn't that (because later I fixed it and it kept throwing error), it was ',' after the 'tablename'. Biggest nonsense in the universe, I know.
from sqlalchemy.
just fyi, black and compatible formatters will format a one-tuple with parents, so your case would have become __tablename__ = ('subusers',)
, making it more visible when there are errant comma
from sqlalchemy.
Related Issues (20)
- `orm.composite` with polymorphic "selectin" loading raises `AttributeError: _wildcard_token` HOT 11
- defaultload().contains_eager() option not expired HOT 2
- Creating an index concurrently using asynpg freezes the program HOT 5
- Some UUIDs are not written correctly in Sqlite HOT 4
- Enums are not created in new type alias syntax HOT 12
- IndexError in Query with string literal + repeated ORM attribute HOT 4
- Parameter substitution fails when statement has a postgres style cast HOT 5
- reflecting oracle synonym of synonym over dblink HOT 4
- Changing decimal separator to comma using locale.setlocale causes crash on MSSQL columns of decimal type HOT 3
- Generated syntax error when using funcs in server_default in MySQL
- NoForeignKeysError and AmbiguousForeignKeysError after upgrade to 2.x HOT 5
- selectin_polymorphic does not work for multiple level joined inheritance HOT 2
- ColumnCollection.get(col, default) types as Optional even with default HOT 2
- bulk_save_objects() w/ return defaults writes incorrect identity key HOT 4
- `sqlalchemy.utils.langhelpers.TypingOnly` too rigidly prevents special dunders from appearing HOT 5
- func.count argument typing issue HOT 1
- Bundle labels are wrong for new style select only (query works ?!) HOT 9
- Use of `raise NotImplementedError` instead of `NotImplemented` HOT 1
- Design a Repository pattern with sqlalchemy HOT 1
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 sqlalchemy.