Comments (6)
@NomeChomsky Thanks for the heads up. I don't use Poetry personally, so haven't encountered this problem, but I know it's a popular tool. I'll fix it by loosening the dependencies a bit.
from piccolo.
@NomeChomsky Try version 0.10.4 of Piccolo Admin - I've loosened the dependencies. Hopefully that solves the problem.
from piccolo.
Fantastic dan.
So far so good with Piccollo. I've been looking for a tool like this - tightly coupled on the back end, with migrations, and loosely coupled on the front.
Piccollo looks promising, and I'm going to see how far I get with a project using it. I must say, I'm an SQL novice. I researched lots of python frameworks which are tightly coupled on the back end. Piccollo looks great. One feature I'd love to see is to integrate a 'human readable' style relationships tooling inspired by Emmett. His docs are really excellent, but so far I wasn't able to make it work seamlessly.
If you look at the way Emmett deals with relationships on models, it's a really nice implementation. I'd love to see this come to Piccollo, because defining relationships is sometimes very abstract and headachey.
For example, how might I deal with circular dependencies when passing the model into the foreignkey field? Can I pass in a string representation?
from piccolo.
To add - I think the command integration is also a very nice idea, and it works nicely. The idea that there's 'a correct way' to integrate table modelling into the project, and that Piccollo will bring that template in is very nice. It's a nice mix between Django 'this is how its done' styling, and Flask's micro framework style. It strikes me as a nice balance.
The Admin tool is the icing on the cake,
from piccolo.
@NomeChomsky I haven't used Emmett before, but just had a look at the docs. With the foreign key relationships in Piccolo, the ForeignKey
column references another Table
subclass.
class Manager(Table):
name = Varchar(length=50)
class Band(Table):
name = Varchar(length=50)
manager = ForeignKey(Manager, null=True)
If you need to have tables which reference themselves, you can do it like this:
class Manager(Table):
name = Varchar(length=50)
manager = ForeignKey('self', null=True)
I see your point though about using string representations, because with very complex schemas you may get circular dependencies. This isn't something Piccolo currently supports, but it wouldn't be too hard to implement. I'll add it to the roadmap.
I'd like to create a tool which shows a graphic representation of the the Piccolo schema - possibly a web app, but that's in the future.
Thanks for your comments and interest in the project. I'm interesting in hearing any other thoughts you have as you build stuff with Piccolo.
from piccolo.
FYI, there's a fix for this in Piccolo 0.14.10 - ForeignKey
can now accept strings, which should prevent circular dependency issues.
class Band(Table):
name = Varchar()
manager = ForeignKey('Manager')
class Manager(Table):
name = Varchar()
https://piccolo-orm.readthedocs.io/en/latest/piccolo/schema/column_types.html#foreignkey
from piccolo.
Related Issues (20)
- Fix `load_json` on joined tables
- Support arrays of timestamp / timestamptz / date / time in SQLite
- cockroachDB extremely long query due to Array(UUID()) HOT 3
- Upgrade CockroachDB
- Is there a way to truncate the table? HOT 3
- Add support for `CAST` to convert between types
- Bump black version
- Add a utility method for getting the innermost type of an `Array` column
- Add support for collation HOT 1
- Add a `having` clause
- `Serial` field won't work in SQLite if it is not the primary key
- `Serial` field won't updates automatically aftes saving in Postgres
- Are bit types supported? HOT 2
- Add one more Engine for PostgreSQL HOT 7
- Support for callbacks at Table level for create update delete HOT 7
- Auto-created index name have a big chance to clash with the table name or name of some structure in the database. HOT 1
- Pressing Enter in `Reverse 1 migration? [y/N]` still leads to reversing. HOT 2
- Add support for `upper` and `lower`
- Fix type warnings in `playground/commands/run.py`
- Add `Album` table to playground
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 piccolo.