Coder Social home page Coder Social logo

Comments (6)

dantownsend avatar dantownsend commented on June 21, 2024

@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.

dantownsend avatar dantownsend commented on June 21, 2024

@NomeChomsky Try version 0.10.4 of Piccolo Admin - I've loosened the dependencies. Hopefully that solves the problem.

from piccolo.

philmade avatar philmade commented on June 21, 2024

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.

philmade avatar philmade commented on June 21, 2024

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.

dantownsend avatar dantownsend commented on June 21, 2024

@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.

dantownsend avatar dantownsend commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.