Comments (3)
I haven't found a better way than to fix the class declaration like this:
class Item(BaseItem):
third = peewee.IntegerField(primary_key=True)
class Meta:
table_name = "item"
I think, for the best, the error should have been there primary_key = peewee.CompositeKey("third")
. Because a composite key is a combination of two or more than two columns.
from peewee.
CompositeKey
is only intended to be used when you have a primary key that uses multiple columns. I'm not sure what you're trying to do here.
from peewee.
@coleifer Would you mind rising an exception when someone is trying to use it in this way peewee.CompositeKey("third")
?
from peewee.
Related Issues (20)
- Full text search with queries HOT 1
- Implement __deepcopy__ and __copy__ methods in Node HOT 10
- Connection won't be recycled after a while HOT 1
- Question regarding transferring tables between two databases HOT 1
- support for fn.PERCENTILE_CONT HOT 1
- Inherited hybrid properties not using ModelAlias
- Peewee installation fails HOT 2
- Installation broken: No module named 'peewee' (v3.17.4) HOT 4
- upsert shortcut for postgresql HOT 2
- Wrong table order in `delete_instance(recursive=True)` causes missing deletion HOT 3
- Performance bottleneck due to locking operations in PooledMySQLDatabase HOT 1
- Hot work "in" HOT 2
- Does db.close() exactly close the database connection in network layer? HOT 1
- Best practices: how to manage classes that may or may not have database data HOT 10
- playhouse.postgres_ext.ServerSide doesn't create server-side cursor HOT 2
- model to dict -> subquery fields HOT 1
- Regression of < used on connections HOT 4
- Correct way to migrate a table to update a ForeignKeyConstraint with `ON DELETE CASCADE` HOT 1
- the count is diffrent HOT 3
- Bind schema - similar to how we can bind database to a model HOT 2
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 peewee.